Im Pretty new to Lucene indexing. I have a table with fields ID ,NAME and NATIONALITY all indexed using an NGRAM Analyzer(2,2). Now i need to query a list of ID's(say 12345 and 98765) from the table. How can i do that?
I tried Boolean Query like this:
BooleanQuery.add("ID:"12 23 34 45" ,Occur.SHOULD);
BooleanQuery.add("ID:"98 87 76 65" ,Occur.SHOULD);
Since indexing is done with Ngram Analyzer with maxgram width as 2. it takes the list and tokens it to set of 2 and searches it;Result-I get a list of ID's with so many values.
I tried Occur.MUST. but returned 0 results.