lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
Subject Re: Score certain documents higher based on a weight field
Date Tue, 10 Apr 2018 08:50:18 GMT
Hi,
In case you are using (e)dismax query parser, you can use bf (additive) or boost (multiplier)
to boost results. You have field function to access the field value (can also just use field
name in most places.

HTH,
Emir 
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 10 Apr 2018, at 01:26, OTH <omer.t.h.7@gmail.com> wrote:
> 
> Hello,
> 
> Is there a way to assign a higher score to certain documents based on a
> 'weight' field?
> 
> 
> E.g., if I have the following two documents:
> {
>        "name":"United Kingdom",
>        "weight":2730,
> } {
>        "name":"United States of America",
>        "weight":11246,
> }
> 
> Currently, if I issue the following query:
> q=name:united
> 
> These are the scores I get:
> {
>        "name":"United Kingdom",
>        "weight":2730,
>        "score":9.464103},
> } {
>        "name":"United States of America",
>        "weight":11246,
>        "score":7.766276}]
> }
> 
> 
> However, I'd like the score to somehow factor in the number in the "weight"
> column.  (And hence, increase the score assigned to "United States of
> America" in this case.)
> 
> Much thanks


Mime
View raw message