Re: Conditions with multiple boosts in bf exists query
Thanks for the response, Erick. Unfortunately, no, these scores aren’t known at index time: they’re specific to the user doing the search, and they can change. Cheers, Eric On 9/7/17, 7:58 PM, "Erick Erickson" wrote: I'd sidestep the problem ;) Are these scores 1> known at index time 2> unchanging (at least until the doc is re-indexed)? If so, pre-compute your boost and put it in the doc at index time. The other thing you can do is use payloads to add a float to specific tokens and incorporate them in at scoring time. See the Solr documentation, if you have a relatively recent one the payload support has been built in to Solr, otherwise here's a primer: https://lucidworks.com/2014/06/13/end-to-end-payload-example-in-solr/ Best, Erick On Thu, Sep 7, 2017 at 8:40 AM, Eric Kurzenberger wrote: > I need to do a bf exists query that matches the following conditions: > > > - IF a_score = 1 AND b_score = 2 THEN boost 30 > > - IF a_score = 3 AND b_score = 4 THEN boost 20 > > So far, the bf portion of my query looks like this: > > if(exists(query({!v="a_score_is:1"})),30,0) > > But I’m having difficulty finding the correct syntax for the multiple conditions and boosts. > > I was originally doing a bq query that looked like this: > > bq=(a_score_is:1 AND b_score_is:2)^30 OR (a_score_is:3 AND b_score_is:4)^20 > > but I found that idf was skewing my rexpected esults, as I don’t care about document frequency. > > Can anyone assist? > > Cheers, > > Eric >
Re: Conditions with multiple boosts in bf exists query
I'd sidestep the problem ;) Are these scores 1> known at index time 2> unchanging (at least until the doc is re-indexed)? If so, pre-compute your boost and put it in the doc at index time. The other thing you can do is use payloads to add a float to specific tokens and incorporate them in at scoring time. See the Solr documentation, if you have a relatively recent one the payload support has been built in to Solr, otherwise here's a primer: https://lucidworks.com/2014/06/13/end-to-end-payload-example-in-solr/ Best, Erick On Thu, Sep 7, 2017 at 8:40 AM, Eric Kurzenberger wrote: > I need to do a bf exists query that matches the following conditions: > > > - IF a_score = 1 AND b_score = 2 THEN boost 30 > > - IF a_score = 3 AND b_score = 4 THEN boost 20 > > So far, the bf portion of my query looks like this: > > if(exists(query({!v="a_score_is:1"})),30,0) > > But I’m having difficulty finding the correct syntax for the multiple > conditions and boosts. > > I was originally doing a bq query that looked like this: > > bq=(a_score_is:1 AND b_score_is:2)^30 OR (a_score_is:3 AND > b_score_is:4)^20 > > but I found that idf was skewing my rexpected esults, as I don’t care about > document frequency. > > Can anyone assist? > > Cheers, > > Eric >
Conditions with multiple boosts in bf exists query
I need to do a bf exists query that matches the following conditions: - IF a_score = 1 AND b_score = 2 THEN boost 30 - IF a_score = 3 AND b_score = 4 THEN boost 20 So far, the bf portion of my query looks like this: if(exists(query({!v="a_score_is:1"})),30,0) But I’m having difficulty finding the correct syntax for the multiple conditions and boosts. I was originally doing a bq query that looked like this: bq=(a_score_is:1 AND b_score_is:2)^30 OR (a_score_is:3 AND b_score_is:4)^20 but I found that idf was skewing my rexpected esults, as I don’t care about document frequency. Can anyone assist? Cheers, Eric