0

I want to create an index file from a very large text file in java. Actually I want to keep the number and the byte of the first character in each line in the index file.I am going to use it to do searching as fast as possible in my original file.

It will be great if someone can help me with a sample code.

1

2 Answers 2

4

Have you checked Apache Lucene?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I checked it before, but I try to find another way to create the index file instead of using this library.
0

An index file is just a mapping Word -> Location. For simple problems you can build that on your own using a Multimap from the word to the locations of the word in the file.

If you need stop lists, stemming and other language processing, pre-, post-, or infix-search you should consider a search engine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.