ComplexPhraseQueryParser class question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ComplexPhraseQueryParser class question

baris.kazar
Hi,-

  I hope everyone is doing great.


i have a question regarrding ComplexPhraseQueryParser class.

This class can handle this queryText case very well:


"term1 erm2 abcd term3*"~2

(last term3 has * at the end and the whole phrase has slop value 2)


The term1, term2 and term3 are all in the Lucene index but abcd is not.

In other words there is no "term1 term2 abcd term3" in the Lucene index

but i still would like to find the following in my results:

"term1 term2 term3" despite having abcd term there.

How can i achieve this?


i setInOrder as true setPhraseSlop as 2 for the ComplexPhraseQueryParser.


Best regards

baris



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

回复:ComplexPhraseQueryParser class question

陈志祥
the standard phrasequery cannot do this, but you can prefilter the invalid term(abcd) out by using MultiTerms api.

Also, I have found that “a b c”~2 phrase query does not really match “a x x b x x c” by its implementation……






<img style="border-radius: 50%;border:none" width="96" height="96" src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCABgAGADASIAAhEBAxEB/8QAHgAAAwEBAAIDAQAAAAAAAAAABgcICQUBAwAECgL/xABGEAABAwMDAgQDBAUHCwUAAAABAgMEBQYRAAcSCCEJEyIxQVFxFDJhgRUjUoKRFhc0obHB0iQlMzVCYpKisuHwcnN0k9H/xAAaAQACAwEBAAAAAAAAAAAAAAAFBgMEBwEC/8QAMxEAAgEDAgMGBAUFAQAAAAAAAQIDAAQRBSESMXEGE0GBobEiMlGRUmHB0eEHFCNC8GL/2gAMAwEAAhEDEQA/AGN4skb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l1Cm0IH4BJWf3PpqWLYhLt5f29l1bUkElp1BwexwrBHsRkfx1obvPvl029B+0M/pm29km5byUgt1sxEgMxn1DCy877JUAAA2nkpOAFcT3Oebk9HlspbbVxaQQDjsck5Om3RBIUZyuFOMZ96RNVkjeQAHJHOnn079Xm4uxkiRFtp2G7EqD6XqlEkRUgSlpGAtSkgK5Y7Zz9c6NumfeXbPbnq6rnUrcyKiyLiTPVJgxktvJZckuJcOCSk8QQfxx89TFS3eSgUK5fs4Ou0ipJiFKw93GPT8TosY42fiPOhBB4So5Gv//Z">
陈志祥
阿里巴巴 地图引擎核心算法工程师
电话:057128223456-81124100
邮箱:[hidden email]
地址:上海-长宁-申通信息广场
<img width="16" height="16" style="border:none" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABdUExURf////Hy8vz8/OXl5cDBwvLz88DAwfLy8vPz87/AwcvMzczNztjZ2tna2+jp6efo6Pn5+eHh4vHx8tbW1+Dg4eDh4cHCw87P0OXl5sbHyNPT1Nvc3ejo6f7+/tfX2GZBokcAAACJSURBVBjTXc8HDsMgDAVQMxwDCWR3t/c/Zj64UseXkNETNkBRE0Srp1iYWSqg8gjgx7AToKNtKKbCEHuFFHODvX8prP1cQYjo2QBZAP+3BI217w2JxlosmkTQ0iGtJZCrD+M67Ae2tAIw45au8fMwHEv6Fy55BkzO3fO5wmiMWb5meE0QLLr40wEwRgfC9LamlwAAAABJRU5ErkJggg==">
<img style="border-radius: 4px;border:none;vertical-align: middle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGK0lEQVRYCY3BfYzXZQEA8M/z/f549bzjfIHDwDtOuMsanoeas5jsUkdS4tjIWJtNp7X+CN2Y/ZFbruncbGP4h26Va2WtFSLLTSVnkISDsGbgzTkVjNeAA+FOjpPj5Pc8T8cdxqGH+PkEn0NAW5P6hVe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nn476ie4VDAsVGi+3ZDXf87mB5EMyUjISEi4eDa3PEHnb9nyGxIyyvFMv5bmDnoP8+9n+LDbSD0n7ahs3afz682ud0pGQKoasmst1URANqxSw9h6ju0nRq65nzEXMPAh199HbROTv0w5ns4/8+oT9H1A8ilbD+ksm2rVdDRZ7GM50X+Exg6++F0uv5mmW5l1B9NuopzI4bcZ+JCE+hamfZWGduqb6d7F5l+x7lF2bmbgBMmont5mebi6Qf3W79ulUKtAgQI1U2iYQ2UCxw/Ss53j75MyGRkJKTC2joTjvcREREIVCcloetuf1VTp7NKzcY9Vcy93r4yMjN6D9L5EcLaMjIyEnDn+AQkRCQkJGcmoNh60qvN9PUXGin9Znk7qFxFRRRURERERVUREREREREQkJCREJKNKWf+KNy3PKA1657Aj1zWoban3NadkZGQkJGQkZCQkJCQkJCQkJGRko1qz1+MPbbbSoOC0xjo1W75nw0UTzFEgGBacLRuWkZCRkZCQkJCMqnvAljnPmre7V59BhdN2H9W3+AVLUtSliioiIiIiIiKqiIiIiIiIiEhGlehavNaS3b36nFYaYdcHuvf2euW2ZreHrEZGQkJCQkZCQkJCQkJGNqpE171/t+C597xlhGAUHY1mrb7VyovGmSP4tIyMjIyM7Jy6B2xZvNaS9Xts9wmlUew6qvuZbf44s05lZq05IRsjIyEhIyEhO6eU9a/Z6/HbX3L3G4d0GUVwHotatC6b7YG5U9yBWp9P78aDVq140/LntnnXZwg+h4C2S9UvnGH+vKk62idrqx+jGXWGHe05acfWQzo3HLD++Z1e7nxfT3Z+/wMRJ5n1jkJEIwAAAABJRU5ErkJggg==" width="32" height="32"> 阿里巴巴 企业主页
信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。
请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息的全部或部分。以上声明仅适用于工作邮件。
Information Security Notice: The information contained in this mail is solely property of the sender's organization.
This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
------------------------------------------------------------------
发件人:<[hidden email]>
日 期:2020年01月30日 05:02:50
收件人:[hidden email]<[hidden email]>
抄 送:baris.kazar<[hidden email]>
主 题:ComplexPhraseQueryParser class question

Hi,-

  I hope everyone is doing great.


i have a question regarrding ComplexPhraseQueryParser class.

This class can handle this queryText case very well:


"term1 erm2 abcd term3*"~2

(last term3 has * at the end and the whole phrase has slop value 2)


The term1, term2 and term3 are all in the Lucene index but abcd is not.

In other words there is no "term1 term2 abcd term3" in the Lucene index

but i still would like to find the following in my results:

"term1 term2 term3" despite having abcd term there.

How can i achieve this?


i setInOrder as true setPhraseSlop as 2 for the ComplexPhraseQueryParser.


Best regards

baris



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: ComplexPhraseQueryParser class question

baris.kazar
Thanks Zhixiang. Yes, it cant find when there is an unrelated term in the middle that is not indexed.

Similar to what You suggested:
i can try the queryText by excluding one term at a time with the ComplexPhraseQueryParser and see best matches.
 But, i'd rather this is embedded into a Lucene api.

My question is asking also whether ComplexPhraseQueryParser has a way to support partial phrase match capability?

Elastic Search has this capability with a percentage indication.

i am surprised Lucene Core does not have this, i hope i am wrong.

Best regards


> On Jan 29, 2020, at 7:02 PM, 陈志祥 <[hidden email]> wrote:
>
> the standard phrasequery cannot do this, but you can prefilter the invalid term(abcd) out by using MultiTerms api.
>
> Also, I have found that “a b c”~2 phrase query does not really match “a x x b x x c” by its implementation……
>
>
>
>
>
>
>
> 陈志祥
> 阿里巴巴 地图引擎核心算法工程师
> 电话:057128223456-81124100
> 邮箱:[hidden email]
> 地址:上海-长宁-申通信息广场
>  
>   阿里巴巴 企业主页
> 信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。
> 请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息的全部或部分。以上声明仅适用于工作邮件。
> Information Security Notice: The information contained in this mail is solely property of the sender's organization.
> This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
> ------------------------------------------------------------------
> 发件人:<[hidden email]>
> 日 期:2020年01月30日 05:02:50
> 收件人:[hidden email]<[hidden email]>
> 抄 送:baris.kazar<[hidden email]>
> 主 题:ComplexPhraseQueryParser class question
>
> Hi,-
>
>   I hope everyone is doing great.
>
>
> i have a question regarrding ComplexPhraseQueryParser class.
>
> This class can handle this queryText case very well:
>
>
> "term1 erm2 abcd term3*"~2
>
> (last term3 has * at the end and the whole phrase has slop value 2)
>
>
> The term1, term2 and term3 are all in the Lucene index but abcd is not.
>
> In other words there is no "term1 term2 abcd term3" in the Lucene index
>
> but i still would like to find the following in my results:
>
> "term1 term2 term3" despite having abcd term there.
>
> How can i achieve this?
>
>
> i setInOrder as true setPhraseSlop as 2 for the ComplexPhraseQueryParser.
>
>
> Best regards
>
> baris
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]