The documents that I am indexing are very large. Lucene by default only indexes the first 10,000 terms of a document to avoid OutOfMemory errors. So I am getting incorrect hits while searching the Index. How could I index all the terms in the document?
1 Answers
0
votes
IndexWriter.MaxFieldLength
. Specifies maximum field length (in number of tokens/terms) in IndexWriter constructors
You can set maximum value as part of IndexWriter constructor MAX_VALUE - Lucene Recent Versions or UNLIMITED - Lucene Older Versions.
You could also use IndexWriter.setMaxFieldLength(int)
to override the value set by the constructor.