For example:
There is a column "description" in a Lucene document. Let's say the content of "description" is [hello foo bar
]. I want a query [hello f
], then the document should be hit, [hello ff
]
or [hello b
] should not be hit.
I use the programmatic way to create the Query
, such as PrefixQuery
, TermQuery
were added to BooleanQuery
, but they don't work as expected. StandardAnalyzer
is used.
Test cases:
a): new PrefixQuery(new Term("description", "hello f"))
-> 0 hit
b): PhraseQuery query = new PhraseQuery();
query.add( new Term("description", "hello f*") )
-> 0 hit
c): PhraseQuery query = new PhraseQuery();
query.add( new Term("description", "hello f") )
-> 0 hit
Any recommendations? Thanks!