elasticsearch


Length normalisation in elasticsearch cross_field multi_match


I am currently implementing a search for people names in a database. It's a structured document that has 3 fields: firstName, middleName, lastName. I started using the cross_fields multi_match query and it works fine unless one corner case.
This is the query that I run:
"multi_match": {
"fields": [
"name.firstName^2",
"name.middleName",
"name.lastName^3"
],
"query": "John Smith",
"operator": "AND",
"type": "cross_fields"
}
I would like the object to be treated as one single long field, but boosted in the order lastName, firstName.
The problem is that the following documents get the same score:
{
"firstName": "John",
"lastName": "Smith"
}
and
{
"firstName": "John",
"middleName": "Adams",
"lastName": "Smith"
}
while if you consider length of a "concatenated" field, the first one is 2/2 match and the second is 2/3 match, so 2/2 should be scored higher.
In other words, I would like to perform length normalization in all fields in the multi_match query, not per-field normalization.
Could you advise me how to achieve this?
Thanks!

Related Links

elasticsearch comparison between fields
Find all ID where ID are not in my blacklist
How to order results by custom value and then by _score
Kibana homepage shows blank after deleting all indices
elasticsearch: update in a nested object (HTTP)
Using Phoenix to help to integrate elastic-search and Hbase. When use sqlline.py,to create table, bad happens
Shards and replicas elastic search
Elasticsearch Completion Suggester - Sort suggestions
Can _score from different queries be compared?
Difference between a “plain” terms query and a terms query using a filter
Elasticsearch: Updating a field that has been set as a document _id via mapping with a path
Return parent data with child document from Elasticsearch
Elasticsearch Giving Incorrect Result When Using “must_not” operator alongwith “must” Operator
ElasticSearch _suggest queries are case sensitive. Want them to be case insensitive
How to normalize periods in elastic search query (such that JJ Abrams == J.J Abrams)?
Elastic Search - Sort By Doc Type

Categories

HOME
amazon-web-services
firebase
opencv-python
barcode-scanner
add-on
systemd
compilation
plaid
openlayers-3
capistrano
ui-automation
save
solution
parsley.js
game-maker
chromecast
distributed-computing
closures
checkout
altium-designer
fusetools
ipa
beego
crud
sap-lumira
annotation-processing
adapter
unmarshalling
guice
phpstorm-2016.1
mongodb-3.4
jade4j
stat
imgur
game-center
get-event-store
hdiv
sendinput
apache-toree
django-static-precompiler
nonlinear-functions
non-linear-regression
nusoap
cordova-ios
amazon-elastic-beanstalk
android-mediarecorder
xmlbeans
fiber
pack
m4
juniper-network-connect
opencyc
pythonxy
supersocket.net
algebraixlib
karma-coverage
scala-macros
text-align
python-curses
flurry-analytics
ildasm
inputbox
nidaqmx
loginview
treeline
webautomation
miglayout
xmi
code39
proxy-server
hyphen
tridion-2011
semantic-merge
audiotoolbox
border-box
jzmq
firebird1.5
opends
dynamic-c
simile
printqueue
external-sorting
iphone-sdk-3.1.3

Resources

Encrypt Message