Hello there,
I'm quite new to ElasticSeach and i have been experiencing some serious difficulties trying to implement it the past few days.
I'm using ElasticSearch in a form on a website.
ES version is 1.4
The form possess some fields such as name, first-name, place, date of beginning, date of end.
I have very specific demands and I haven't been able to answer to one of them.
When someone fills the field "name" and press "search" i have been asked to provide results for matching on the full family name, a part of the family name, the full birth-name and a part of the birth-name.
Since i have very specific sort requirements the scores of the match on the full family name and the full birth-name must be very high and the same.
I had no problem doing it for the family name only :
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "myname",
"fields": [
"defunt.nom^30",
"defunt.nom.ngram"
],
"operator": "and"
}
}
]
}
},
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"avis.parutions.datePublication": {
"order": "desc"
}
},
{
"defunt.nom": {
"order": "asc"
}
},
{
"defunt.prenom": {
"order": "asc"
}
},
{
"avis.lieuxConcernes.ville": {
"order": "asc"
}
},
{
"avis.ceremonie.adresse.ville": {
"order": "asc"
}
}
]
}
But i can't do it for the birthname...
Keep in mind i can't make a separate "must" clause because there is no "birthname" field in the form. there is a birthname in the ES index which i have to query when someone query the family name.
Some other must clauses can be added if the user fill more fields too.
What i would like to have is something which would return all the documents which match the full family-name with a score of let's say 30, all the documents which match the full birth-name with the same score of 30 and finally all the documents which match partial family and birth names.
Any help would be greatly appreciated, if you need more details let me know and please forgive my english as it's not my native language.