elasticsearch


elasticsearch: boost query based on values of a variable


I understand how to boost query in elasticsearch depending on absolute value of a variable. For example
{
"query": {
"bool": [
{ "match": {"field1": {"query": 10, "boost": 2}} }
]
}
}
What I need to do is to make sure the field1 influences the score but I dont know any absolute value. For example, document will field1 = 20 will get higher score as compared to document with field1 = 10. However, this is different from sort. Because sorting is absolute. I just want this variable to contribute to the overall score but this is not the only field controlling the overall score.
The best solution here would be function_score query
It can be seen as the swiss army knife for customizing scores.
You can use field_value_factor function in it to achieve what you are looking for.

Related Links

MapperParsingException when logging requests with bunyan/logstash/elasticsearch
logstash if field exists then grok
ElasticSearch - Throughput gradually decreases from 100k to 20k
ElasticSearch can't get the TransPortClient when connect the local env
elasticsearch calculate average of unique values
Elasticsearch management tools like phpMyAdmin for mysql [closed]
Trying to set an analyzer for my Elasticsearch index
Apply grok for logfiles
How to limit ElasticSearch results by a field value?
elastic search sort aggregation by selected field
How to add a new node to my Elasticsearch cluster
logstash 2.2.2 hang “Logstash startup completed” while import csv file
Elasticsearch Array
Average without outliers
Fluentd Elasticsearch target index
Kibana showing data from two ES instances

Categories

HOME
ionic2
mod-rewrite
plesk
azure-functions
yahoo-weather-api
activex
message-queue
dronekit-python
greasemonkey
yahoo
lc3
cqrs
pm2
pushdown-automaton
xbox360
corona
libgit2
akka-persistence
neo4j.rb
el
conda
background-color
history.js
tortoisehg
javax.persistence
fusion
location-services
infopath2010
lxml
android-collapsingtoolbar
serversocket
cloveretl
cmis
jslint
eclipse-gmf
aurelia-http-client
right-click
plane
newtons-method
get-event-store
data-uri
word-cloud
jqgrid-asp.net
audio-converter
liteide
spongycastle
cloudwatch
cordova-ios
palindrome
word-2007
glassfish-4.1
nsrunloop
jtag
wolfram-language
static-methods
timestamping
as3-api
webgrind
ajax4jsf
ui4j
variable-length-array
decidable
netdatacontractserializer
artisan
webproject
prism-4
htmltidy
mojo
cakephp-2.2
zend-mail
dmake
multivariate-testing
siena
csslint
refit
oxygene
spring-social-linkedin
iirf
bcdedit
jquery-lazyload
itunes-sdk
gprof
idispatch
stretch
image-formats
asio
haiku
office-automation
qcar-sdk
dip
icicles
tabbarcontroller
main-method
motif
datagridcolumn
service-factory
webclient.uploaddata

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile