i'm trying to index some long texts with Lucene 4.7, i thought that all was fine but i realise that my search hits are not complete.
After a long search i found a web page that said something like "When I try to index a long text in Lucene, Lucene only index the first n characters to prevent stackoverflows."
I want to index full texts and i don't know how to do it ¿Some hel please?. Here is my code:
File indexDir = new File(indexPath);
Directory directory = FSDirectory.open(indexDir);
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_47, analyzer);
config.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
writer = new IndexWriter(directory, config);
Document doc = new Document();
doc.add(new DoubleField("textID", textID, Field.Store.YES));
doc.add(new TextField("text", text, Field.Store.NO));
doc.add(new TextField("title", title, Field.Store.NO));
doc.add(new StringField("discourse", discourse, StringField.Store.YES));
writer.addDocument(doc);