Hello Vinay, If you want to boost on the author field, but not specifically search in it, it must not be listed in qf, but treated as a boost query, using the boost parameter [1], to create a BoostQuery [2]. You can do all sorts of fun things with it because function queries [3] are extremely versatile.
With it, you could do a subquery query() that queries the author field using the user's main query text. If that matches, its score, or the score you define using if() or def(), is multiplied against the document's score. Regards, Markus [1] https://solr.apache.org/guide/6_6/the-extended-dismax-query-parser.html [2] https://solr.apache.org/guide/6_6/other-parsers.html [3] https://solr.apache.org/guide/6_6/function-queries.html Op wo 23 jun. 2021 om 11:38 schreef Vinay Rajput <vinayrajput4...@gmail.com >: > Hi All, > > Just checking in again to get some opinion on it. > > On Mon, Jun 21, 2021 at 1:45 AM Vinay Rajput <vinayrajput4...@gmail.com> > wrote: > > > Hi All, > > > > We are using Solr 7.3.1 in PROD and have a few thousand blogs indexed in > > Solr along with other types of documents. I am working on a requirement > > where we need to give more weight to the author field if someone is > > searching for "Author name + topic". > > > > For example, let's say we have three fields - author, title, text. If we > > search "Brian marketing" then those "marketing" blogs where "Brian" is > the > > author should be ranked higher than other blogs where "Brian" is > mentioned > > in either title or text fields. > > > > In order to achieve this, I thought of giving more weight to the author > > field. This looks ok but I also had to update mm (minimum match) > > parameter from 100% to 1 in solrconfig.xml file otherwise the author > field > > wouldn't even be matched in case of phrase queries. Now as a side effect > of > > this mm change, total hit count has increased dramatically which affects > > precision. > > I did something like this in solrconfig.xml, I tried to use conditional > mm > > to minimize the impact of this change for other fields especially in case > > of larger phrase query :- > > > > <str name="defType">edismax</str> > > > > <str name="qf">title^2 author^3 text</str> > > > > <str name="mm">1<50% 4<-1</str> > > > > <str name="tie">0.1</str> > > > > Now, here are my questions :- > > 1) Is there any way to just override mm(=1) for the author field and keep > > mm = 100% for all other fields? > > 2) Is my approach correct? Is there any better way to achieve the desired > > result? > > > > Thanks in advance. > > > > Regards, > > Vinay > > >