I have an index, where each document represents a class, with list of students and a list of teachers.
Here is the mapping:
{
"properties" : {
"students" : {
"include_in_root" : 1,
"type" : "nested",
"properties" : {
"name" : {
"first" : "text",
"last" : "text",
},
},
"email" : { "type" : "string", "index" : "not_analyzed" },
},
"teachers" : {
"include_in_root" : 0,
"include_in_all" : 0,
"type" : "nested",
"properties" : {
"name" : {
"title" : { "type" : "string", "index" : "not_analyzed" },
"first" : "text",
"last" : "text",
},
},
},
},
}
I would like to influence Elastic Search score function, such that it will give higher score to documents with matched techers.
For example, if I have search for "Smith", I would like the documents with teacher Smith be with higher score than documents with students Smith.
Does anyone knows how it should be done in Elastic Search? In other words, how can I return the results ordered by some logic?
Thanks in advance!