elasticsearch


boost the score relative to term location in field elasticsearch


Query
{"query":{"query_string":{"query":"name:pi*"}}}
Out put
hits: [
{
_score: 1
_source: {
handle: PIXIES
name: Pixies
}
}
{
_score: 1
_source: {
handle: twentyonepilots
name: twenty one pilots
}
}
{
_score: 1
_source: {
handle: Antonio_Pinto
name: Antonio Pinto
}
}
{
_score: 1
_source: {
handle: null
name: Piano Tribute Players
}
}
{
_score: 1
_source: {
handle: null
name: Los Pinguos
}
}
{
_score: 1
_source: {
handle: null
name: Piyush Mishra & Bhupesh Singh
}
}
{
_score: 1
_source: {
handle: pinkfloyd
name: Pink Floyd
}
}]
If you look at the results it matches the terms in name with pi*, which is what I expect from the above query.
But how to write a query to sort results with term location(position index) in the field.
The results of that query should make Piano Tribute Players, Pink Floyd to pop up on the top of list. Since they begin with pi*
similar question on solr: SOLR: Boosting based on location of search term in field

Related Links

Elasticsearch: aggregations and one-to-many relationship
Elasticsearch: find listings within specific distance from polygon
Why didn't the minimum_should_match parameter remove these spurious results?
How can I create Nest ElasticSearch client with default index and custom analyzer?
In Elasticsearch where to generate keystore and add authentication in readonlyrest plugin?
Kibana unexpectedly changed timeFieldName
Spring Data ElasticSearch - cannot connect to node
How to reverse search given a new document in the query in elasticsearch?
ElasticSearch Failed to create index
difference between field and term query or match query
Cluster Block Exception on Elasticsearch
Elasticsearch query for sum of part of a document
how does the logstash kv{} feature work?
Logstash ruby filter conditional statement error
How to change index field as not analyzed in elastic search while writing a dataframe?
What is the theory behind, Elasticsearch indexing the unstructured data like pdf files?

Categories

HOME
rust
firebase
apache-nifi
macos-sierra
xcode
schema.org
devexpress
loopbackjs
code-formatting
ant
dependencies
amp
jpa-criteria
hystrix
alljoyn
circleci
multi-step
spring-jpa
django-rq
max-msp-jitter
mahout-recommender
l20n
hidden
bazaar
cmake-gui
azure-machine-learning
weex
el
bosun
stackexchange.redis
animated-gif
ipa
spring-annotations
nic
kendo-listview
formsauthenticationticket
fastlane
cheat-engine
gitolite
sspi
linq.js
robust
sonarqube5.2
gestures
simple-schema
dtd
emf-compare
controllers
e
tsqlt
seccomp
jenkins-workflow
adp
highlighting
accessibilityservice
seadragon
django-validation
ajax4jsf
python-cffi
google-maps-api-2
screen-orientation
actionpack
wicked-gem
kotlin-android-extensions
kognitio-wx2
nanomsg
lifetime
relationships
box2dweb
maven-central
typesafe-stack
grails-2.3
virtual-channel
libxml-js
spiral
jbox2d
android-authenticator
cmath
ntlmv2
dojo-1.9
linkbutton
telerik-ajax
liveconnect
fitch-proofs
kolite
infopath-2007
filelock
qt-mobility
winsxs
printqueue
html-generation

Resources

Encrypt Message