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<http://www.starwars.com)%5e10%3c/str>> > <str name="q">Carrie Fisher</str> > <str name="bq">url:( > http\:\/\/www.imdb.com\/name\/nm0000402/<http://www.imdb.com/name/nm0000402/>)^8</str> > <str name="q">Mark Hamill</str> > <str name="bq">url:( > http\:\/\/www.imdb.com\/name\/nm0000434/<http://www.imdb.com/name/nm0000434/>)^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://lucene.apache.org/solr/guide/6_6/requesthandlers-and-searchcomponents-in-solrconfig.html#RequestHandlersandSearchComponentsinSolrConfig-SearchHandlers 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://lucene.apache.org/solr/guide/6_6/the-query-elevation-component.html Thanks, Shawn