[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Needs advice on auto-keyword-correction mode custom query
From:       Mikhail Khludnev <mkhl () apache ! org>
Date:       2020-01-06 20:04:34
Message-ID: CAF8TkC4h9z7YfNfWge5cbiF6c5-3w1OeBdrEH=_5_bD1aWngTw () mail ! gmail ! com
[Download RAW message or body]


I think you need to search A for single doc with early termination. And
then search for either A or B.
The closest conditional logic query is WAND, but it doesn't do what's asked
here.
btw, IndexSearcher combines Indices, and Queries.

On Mon, Jan 6, 2020 at 7:33 AM 小鱼儿 <ctengctsh@gmail.com> wrote:

> 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...
>


-- 
Sincerely yours
Mikhail Khludnev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic