lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 小鱼儿 <>
Subject Needs advice on auto-keyword-correction mode custom query
Date Mon, 06 Jan 2020 04:33:12 GMT
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...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message