Hi everybody,

I want to implement an auto-keyword-correction mode custom query: suppose a
scenario where user inputs a keyword query A, but due to typo or other
reasons, A should be B, A is not a valid term in lucene's index which B is.
(I'm not considering NLP in high-dimensional semantice space which is out
of scope here)

I could use 2 queries to do this, but it's too costly. What i need is a
"early-termination" mode:
 (1) keyword A will hit a non-empty DocIDSet so will not query B; Or
 (2) keyword A's DocIDSet will be empty and B's will then match

That is "A OR B" likewise in C/C++ language. But here i notice Lucene's
BooleanQuery's SHOULD relationship is not the solving way. Perhaps i need
to implement another custom query class?

btw, How can Lucene's Query API become high-order composable? Lucene's
"LeafContext" concept is really very confusing me...

Reply via email to