You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Gregg Donovan <gr...@gmail.com> on 2020/09/25 19:06:51 UTC
Exact sub-phrase matching?
Hello!
I'm wondering what the state-of-the-art for matching exact sub phrases
within Lucene is. As a bonus, I'd love to attach a boost to each of the
subphrases matched (if possible).
For example:
doc 1: "field": "tree skirt <position gap> spring skirt <position gap>
spring dress"
doc 2: "field": "christmas tree skirt <position gap> winter skirt <position
gap> christmas dress"
doc 3: "field" "skirt <position gap> spring dress <position gap> dress"
query: christmas tree skirt
This should match doc 1 and 2 but not doc 3. I'd like to also to score doc
2 higher for having a longer match. Ideally, I'd love to add a score to
each of these phrases and use that at scoring time, too.
Thanks!
Gregg Donovan
Senior Staff Software Engineer, Etsy.com
Re: Exact sub-phrase matching?
Posted by Erick Erickson <er...@gmail.com>.
Have you looked at edismax, pf2 and pf3?
On Fri, Sep 25, 2020, 15:07 Gregg Donovan <gr...@gmail.com> wrote:
> Hello!
>
> I'm wondering what the state-of-the-art for matching exact sub phrases
> within Lucene is. As a bonus, I'd love to attach a boost to each of the
> subphrases matched (if possible).
>
> For example:
>
> doc 1: "field": "tree skirt <position gap> spring skirt <position gap>
> spring dress"
> doc 2: "field": "christmas tree skirt <position gap> winter skirt <position
> gap> christmas dress"
> doc 3: "field" "skirt <position gap> spring dress <position gap> dress"
>
> query: christmas tree skirt
>
> This should match doc 1 and 2 but not doc 3. I'd like to also to score doc
> 2 higher for having a longer match. Ideally, I'd love to add a score to
> each of these phrases and use that at scoring time, too.
>
> Thanks!
>
> Gregg Donovan
> Senior Staff Software Engineer, Etsy.com
>