You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by marotosg <ma...@gmail.com> on 2017/07/20 10:35:33 UTC
Boost by Integer value on top of query
Hi,
I have a use where I need to boost documents based on two integer values.
Basically I need to retrieve companies using specific criteria like Company
name, nationality etc.
On top of that query I need to boost the most important ones which are
suppose to be the ones with higher number of employees or locations around
the world.
These are two integer fields on my Solr index. My question here is
How can I boost the companies with a higher number of employees or
locations?
Thanks,
Sergio MAroto
--
View this message in context: http://lucene.472066.n3.nabble.com/Boost-by-Integer-value-on-top-of-query-tp4346948.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Boost by Integer value on top of query
Posted by marotosg <ma...@gmail.com>.
Thanks a lot for the answer.
I finally achieve this using boost and scale function on top of my query
https://wiki.apache.org/solr/FunctionQuery#scale
Thanks to scale no matter how big are the values or small on my People and
Assignment Columns I can range them to a value between 1 and 2.
{!boost b=sum(scale(PeopleTotal,1,2),scale(AssignmentsTotal,1,2))}
--
View this message in context: http://lucene.472066.n3.nabble.com/Boost-by-Integer-value-on-top-of-query-tp4346948p4348329.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Boost by Integer value on top of query
Posted by Erik Hatcher <er...@gmail.com>.
If you’re using edismax, adding a boost parameter `boost=num_employees&boost=num_locations` should incorporate those integers into the scores. Just try one at a time at first - you’ll likely want to wrap it into a single function, along the lines of something like `boost=mul(num_employees,num_locations)`
Erik
> On Jul 20, 2017, at 6:35 AM, marotosg <ma...@gmail.com> wrote:
>
> Hi,
>
> I have a use where I need to boost documents based on two integer values.
> Basically I need to retrieve companies using specific criteria like Company
> name, nationality etc.
> On top of that query I need to boost the most important ones which are
> suppose to be the ones with higher number of employees or locations around
> the world.
>
> These are two integer fields on my Solr index. My question here is
> How can I boost the companies with a higher number of employees or
> locations?
>
> Thanks,
> Sergio MAroto
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Boost-by-Integer-value-on-top-of-query-tp4346948.html
> Sent from the Solr - User mailing list archive at Nabble.com.