Hi,
I am using ElasticSearch 6.1.3 and have the following situation.
Let me start sharing the query I am using.
POST develop/_search
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "omega 7",
"fields": ["merk.naam^2", "categorie.naam^14", "naam^70", "did_you_mean"],
"operator": "and"
}
}
]
}
},
"track_scores": true,
"sort": [
{
"type.keyword": {
"order": "asc"
}
},
{
"populariteitscijfer": {
"order": "desc"
}
}
]
}
With this query I get the results I want based on the scores and all (omega 3 is not appearing).
Seen in: http://drops.3ws.nl/qstszh
But when I change "omega 7" to "omega 3" the omega 7 category is also showing.
Seen in: http://drops.3ws.nl/NWHLl5
I cannot figure out why this is happening. Since the reversal does not include that category.
When I run the analyzer like this:
GET develop/_analyze
{
"analyzer": "didYouMean",
"text": ["omega 3"]
}
This is the result for it:
{
"tokens": [
{
"token": "omega",
"start_offset": 0,
"end_offset": 5,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "visolie",
"start_offset": 0,
"end_offset": 7,
"type": "SYNONYM",
"position": 0,
"positionLength": 2
},
{
"token": "3",
"start_offset": 6,
"end_offset": 7,
"type": "<NUM>",
"position": 1
}
]
}
I am itching my head over this. Hope someone can help out.
Greetings,
Peter
Edit::
This is the contents of the field: did_you_mean with the query:
{
"_index": "development-2018032812",
"_type": "doc",
"_id": "categorie-485",
"_score": 4.3321357,
"fields": {
"did_you_mean": [
"Omega-7"
]
},
"sort": [
"categorie",
-9223372036854776000
]
},
{
"_index": "development-2018032812",
"_type": "doc",
"_id": "categorie-1",
"_score": 632.3207,
"fields": {
"did_you_mean": [
"Omega-3"
]
},
"sort": [
"categorie",
-9223372036854776000
]
}