Elastic search boosting


(pansarivipuljain) #1

Hi Guys,

In my elastic search data there is different number of companies with there
whole address and each companies has specific count on the basis of this we
define the boosting factor, means max count companies having max score.

my searching query is :

    {"from":0,"size":10, "query":{
   "custom_score" : {
     "query" : {
     "match" : {"COMPANY" : {"query" : "*google*", "type" : 

"phrase_prefix", "boost":2}}
},
"script" : "_score/_score * doc['COUNT'].value"

       }
       }
       }

it work fine for me.

now one more thing i want in this. if the user country is canadian then
canadian companies should be display first with the max count factor and if
user country is US then US companies should be display first.

Means i want to boost the result on the basis of COUNT and COUNTRY both.

can any one help me on this, what should be the query for this type of
boosting.

Thanks,
Vipul

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2