unified highlighter methods works unexpected

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

unified highlighter methods works unexpected

Szűcs Roland
Hi All,

I use Solr 8.4.1 and implement suggester functionality. As part of the
suggestions I would like to show product info so I had to implement this
functionality with normal query parsers instead of suggester component. I
applied an edgengramm filter without stemming to fasten the analysis of the
query which is crucial for the suggester functionality.
I could use the Highlight component with edismax query parser without any
problem. This is a typical output if hl.method=original (this is the
default):
{ "responseHeader":{ "status":0, "QTime":4, "params":{ "mm":"3<74%", "q":"Arany
Já", "tie":"0.1", "defType":"edismax", "hl":"true", "echoParams":"all", "qf
":"author_ngram^5 title_ngram^10", "fl":"id,imageUrl,title,price",
"pf":"author_ngram^15
title_ngram^30", "hl.fl":"title", "hl.method":"original", "_":
"1585830768672"}}, "response":{"numFound":2,"start":0,"docs":[ { "id":"369",
"title":"Arany János összes költeményei", "price":185.0, "imageUrl":"
https://cdn.bknw.net/prd/covers_big/369.jpg"}, { "id":"26321", "title":"Arany
János összes költeményei", "price":1400.0, "imageUrl":"
https://cdn.bknw.net/prd/covers_big/26321.jpg"}] }, "highlighting":{ "369":{
"title":["\n <strong>\n Arany\n </strong>\n János összes költeményei"]}, "
26321":{ "title":["\n <strong>\n Arany\n </strong>\n János összes
költeményei"]}}}

If I change the method to unified, I get unexpected result:
{ "responseHeader":{ "status":0, "QTime":5, "params":{ "mm":"3<74%", "q":"Arany
Já", "tie":"0.1", "defType":"edismax", "hl":"true", "echoParams":"all", "qf
":"author_ngram^5 title_ngram^10", "fl":"id,imageUrl,title,price",
"pf":"author_ngram^15
title_ngram^30", "hl.fl":"title", "hl.method":"unified", "_":"1585830768672"
}}, "response":{"numFound":2,"start":0,"docs":[ { "id":"369", "title":"Arany
János összes költeményei", "price":185.0, "imageUrl":"
https://cdn.bknw.net/prd/covers_big/369.jpg"}, { "id":"26321", "title":"Arany
János összes költeményei", "price":1400.0, "imageUrl":"
https://cdn.bknw.net/prd/covers_big/26321.jpg"}] }, "highlighting":{ "369":{
"title":[]}, "26321":{ "title":[]}}}

Any idea why the newest method fails to deliver the same results?

Thanks,
Roland
Reply | Threaded
Open this post in threaded view
|

Re: unified highlighter methods works unexpected

David Smiley
Hi Roland,

I was not able to reproduce this.  I modified the tech_products same config
to change the name field to use a new field type that had a trivial
edgengram config.  Then I composed this query based. alittle on some of
your parameters, and it did find highlights:
http://localhost:8983/solr/techproducts/select?defType=edismax&fl=id%2Cname&hl.fl=name&hl.method=unified&hl=on&mm=3%3C74%25&q=%22hard%20dri%22&qf=name%20text&stopwords=true&tie=0.1

If you could help me in telling me reproducibility instructions with
tech_products, then I can help diagnose the underlying problem and possibly
fix.

~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley


On Thu, Apr 2, 2020 at 9:02 AM Szűcs Roland <[hidden email]>
wrote:

> Hi All,
>
> I use Solr 8.4.1 and implement suggester functionality. As part of the
> suggestions I would like to show product info so I had to implement this
> functionality with normal query parsers instead of suggester component. I
> applied an edgengramm filter without stemming to fasten the analysis of the
> query which is crucial for the suggester functionality.
> I could use the Highlight component with edismax query parser without any
> problem. This is a typical output if hl.method=original (this is the
> default):
> { "responseHeader":{ "status":0, "QTime":4, "params":{ "mm":"3<74%",
> "q":"Arany
> Já", "tie":"0.1", "defType":"edismax", "hl":"true", "echoParams":"all", "qf
> ":"author_ngram^5 title_ngram^10", "fl":"id,imageUrl,title,price",
> "pf":"author_ngram^15
> title_ngram^30", "hl.fl":"title", "hl.method":"original", "_":
> "1585830768672"}}, "response":{"numFound":2,"start":0,"docs":[ {
> "id":"369",
> "title":"Arany János összes költeményei", "price":185.0, "imageUrl":"
> https://cdn.bknw.net/prd/covers_big/369.jpg"}, { "id":"26321",
> "title":"Arany
> János összes költeményei", "price":1400.0, "imageUrl":"
> https://cdn.bknw.net/prd/covers_big/26321.jpg"}] }, "highlighting":{
> "369":{
> "title":["\n <strong>\n Arany\n </strong>\n János összes költeményei"]}, "
> 26321":{ "title":["\n <strong>\n Arany\n </strong>\n János összes
> költeményei"]}}}
>
> If I change the method to unified, I get unexpected result:
> { "responseHeader":{ "status":0, "QTime":5, "params":{ "mm":"3<74%",
> "q":"Arany
> Já", "tie":"0.1", "defType":"edismax", "hl":"true", "echoParams":"all", "qf
> ":"author_ngram^5 title_ngram^10", "fl":"id,imageUrl,title,price",
> "pf":"author_ngram^15
> title_ngram^30", "hl.fl":"title", "hl.method":"unified",
> "_":"1585830768672"
> }}, "response":{"numFound":2,"start":0,"docs":[ { "id":"369",
> "title":"Arany
> János összes költeményei", "price":185.0, "imageUrl":"
> https://cdn.bknw.net/prd/covers_big/369.jpg"}, { "id":"26321",
> "title":"Arany
> János összes költeményei", "price":1400.0, "imageUrl":"
> https://cdn.bknw.net/prd/covers_big/26321.jpg"}] }, "highlighting":{
> "369":{
> "title":[]}, "26321":{ "title":[]}}}
>
> Any idea why the newest method fails to deliver the same results?
>
> Thanks,
> Roland
>