How to get parsed terms of a document - Lucene

69 views Asked by At

I am using Apache Lucene 5.1.0 for indexing, and I am also using a custom StopFilter.

I am trying to find a way to save, in addition to saving terms in the Lucene Index, a dictionary of document id and a list of the parsed terms from that document.

I couldn't understand how to retrieve the terms after Lucene analyzes the document and removes the stopwords.

Any help would be appreciated - I am basically trying to find a way to use the terms and link it to the original document.

Document document = new Document();

            Reader reader = new FileReader(file);
            document.add(new TextField("fieldname",reader));

            iwriter.addDocument(document);
0

There are 0 answers