Hello im new to elasticsearch and .net.
im trying to filter my results and show exact match first.
Here is my mapping
"formationContinues": {
"properties": {
"dateObtention": {
"type": "integer"
},
"id": {
"type": "integer"
},
"organisme": {
"type": "text",
"boost": 1.5,
"analyzer": "english"
},
"pays": {
"properties": {
"code": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "integer"
},
"langue": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"nom": {
"type": "text",
"boost": 2,
"analyzer": "english"
}
}
},
"titre": {
"type": "text",
"boost": 1.5,
"analyzer": "english"
}
}
}
here is the settings
{"cv_search_dev_en": {
"settings": {
"index": {
"number_of_shards": "5",
"provided_name": "cv_search_dev_en",
"creation_date": "1550583725461",
"analysis": {
"filter": {
"english_keywords": {
"keywords": [
"example"
],
"type": "keyword_marker"
},
"english_stemmer": {
"type": "stemmer",
"language": "english"
},
"english_possessive_stemmer": {
"type": "stemmer",
"language": "possessive_english"
},
"english_stop": {
"type": "stop",
"stopwords": "_english_"
}
},
"analyzer": {
"english": {
"filter": [
"english_possessive_stemmer",
"lowercase",
"english_stop",
"english_keywords",
"english_stemmer",
"asciifolding",
"lowercase"
],
"tokenizer": "standard"
},
"neutral_analyzer": {
"filter": [
"lowercase",
"english_stop",
"asciifolding"
],
"tokenizer": "standard"
}
}
},
"number_of_replicas": "1",
"uuid": "n71tIFNEQoypjv5rzFhkEA",
"version": {
"created": "6030099"
}
}
}
}
}
here is the nest query:
QueryContainer queryContainer = new BoolQuery
{
Should = new QueryContainer[ ] {
new QueryStringQuery { Query = query,DefaultOperator=Operator.Or, Fields = SearchFields.fields.ToArray()},
},
};