Sunday, April 1, 2018

FW: Boosting Fields Based On The Query Provided

-----Original Message-----
From: Mukhopadhyay, Aratrika [mailto:Aratrika.Mukhopadhyay@mail.house.gov]
Sent: 22 March 2018 18:48
To: solr-user@lucene.apache.org
Subject: RE: Boosting Fields Based On The Query Provided

Thanks for your reply Shawn. The query elevation worked for us. I have
another question though. Right now I have ways to handle specific queries in
the elevate.xml. The concern I am having is that I may have hundreds of
queries that need to return different pages first. Is the only way to do
this via the elevate.xml or is there a better approach for instance boosting
fields ? When I am boosting fields in this fashion it is not working for me
:

<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf"> url^50 host^30 content^20 title^10</str>
</lst>
<arr name="last-components">
<str>elevator</str>
</arr>
</requestHandler>


Thanks for your help .

Aratrika Mukhopadhyay
-----Original Message-----
From: Shawn Heisey [mailto:apache@elyograg.org]
Sent: Tuesday, March 20, 2018 6:03 PM
To: solr-user@lucene.apache.org
Subject: Re: Boosting Fields Based On The Query Provided

On 3/20/2018 2:25 PM, Mukhopadhyay, Aratrika wrote:
> I have a solr query which I am having a hard time configuring as I
would want it configured. Suppose I have a situation where I have two fields
field1(host field) and field2 (url field). I want a specific host to be
bubbled to the top for all terms except for when I am searching for specific
people in which case I want the URL to their landing page returned first. I
have configured the dismax query parser in my solrconfig but it seems that
the boost being applied is arbitrary .

<snip>

> <requestHandler name="/select" class="solr.SearchHandler">
> <lst name="defaults">
> <str name="defType">edismax</str>
> <str name="q">*:*</str>
> <str
name="bq">host:(www.starwars.com)^10</str<https://urldefense.proofpoint.com/
v2/url?u=http-3A__www.starwars.com-29-255e10-253c_str&d=DwID-g&c=L93KkjKsAC9
8uTvC4KvQDTmmq1mJ2vMPtzuTpFgX8gY&r=fbfOUDlf9NEzjz9RxL3c7eXnjEvWEy5WPCDMJD237
NoEoCTMyiD1VH-RfTq9OP14&m=1RjiyUG9se2vpXYg-oLAiacdECUE6khXtuvegnw_nb0&s=QkEn
Izj19X_nqC298QkAUDbjv_zmP1Xr9Vn_z6BQXoM&e=
>>
> <str name="q">Carrie Fisher</str>
> <str name="bq">url:(
http\:\/\/www.imdb.com\/name\/nm0000402/<https://urldefense.proofpoint.com/v
2/url?u=http-3A__www.imdb.com_name_nm0000402_&d=DwID-g&c=L93KkjKsAC98uTvC4Kv
QDTmmq1mJ2vMPtzuTpFgX8gY&r=fbfOUDlf9NEzjz9RxL3c7eXnjEvWEy5WPCDMJD237NoEoCTMy
iD1VH-RfTq9OP14&m=1RjiyUG9se2vpXYg-oLAiacdECUE6khXtuvegnw_nb0&s=ka0--rJJLml1
zFZu_P1xPisIiLpXR5LwsIMm82TuoUk&e=
>)^8</str>
> <str name="q">Mark Hamill</str>
> <str name="bq">url:(
http\:\/\/www.imdb.com\/name\/nm0000434/<https://urldefense.proofpoint.com/v
2/url?u=http-3A__www.imdb.com_name_nm0000434_&d=DwID-g&c=L93KkjKsAC98uTvC4Kv
QDTmmq1mJ2vMPtzuTpFgX8gY&r=fbfOUDlf9NEzjz9RxL3c7eXnjEvWEy5WPCDMJD237NoEoCTMy
iD1VH-RfTq9OP14&m=1RjiyUG9se2vpXYg-oLAiacdECUE6khXtuvegnw_nb0&s=sVRAvHN3kkJV
jN8XTAWjZS85tUmOXp9W4exWvMPpGUk&e=
>)^8</str>
> </lst>
> </requestHandler>

I think there's a fundamental misunderstanding of how "defaults" works.

I have no idea what happens with multiple "q" parameters, which you have
configured in defaults.  I do know that if your request includes a "q"
parameter, then what you've put in defaults for "q" is going to be
overridden and ignored.

This section of the documentation covers defaults, appends, and invariants:

https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_solr_
guide_6-5F6_requesthandlers-2Dand-2Dsearchcomponents-2Din-2Dsolrconfig.html-
23RequestHandlersandSearchComponentsinSolrConfig-2DSearchHandlers&d=DwID-g&c
=L93KkjKsAC98uTvC4KvQDTmmq1mJ2vMPtzuTpFgX8gY&r=fbfOUDlf9NEzjz9RxL3c7eXnjEvWE
y5WPCDMJD237NoEoCTMyiD1VH-RfTq9OP14&m=1RjiyUG9se2vpXYg-oLAiacdECUE6khXtuvegn
w_nb0&s=LcNEhj3Y-S5KMW2HP0CG9t9UpRgEVsTcP7u8QgqW3tk&e=


I think the Query Elevation Component might be the kind of functionality
you're after.  What you're trying to do with defaults is NOT going to work.

https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_solr_
guide_6-5F6_the-2Dquery-2Delevation-2Dcomponent.html&d=DwID-g&c=L93KkjKsAC98
uTvC4KvQDTmmq1mJ2vMPtzuTpFgX8gY&r=fbfOUDlf9NEzjz9RxL3c7eXnjEvWEy5WPCDMJD237N
oEoCTMyiD1VH-RfTq9OP14&m=1RjiyUG9se2vpXYg-oLAiacdECUE6khXtuvegnw_nb0&s=I6TEN
NcAZab0ZE_j0tZ8hm8_7nuNFqhBwoey4Mm1T0E&e=


Thanks,
Shawn

No comments:

Post a Comment