Hi everybody,
Just stepping in to the world of ES so I'm sorry if I am a bit of a newbie.
Currently I'm stuck at a point in ES and I can't seem to find an awser online, perhaps one of you could be of assistance.
What I'm trying is the following, whilst using a synonym list I would like to use a query string.
As an example:
Input = 'corporation' + 'garage'
Synonym = corporation > company
Result = 'The garage company'
At this time I've got the synonym list working using the code below.
PUT company
{
"settings": {
"analysis": {
"filter": {
"my_synonym_filter": {
"type": "synonym",
"synonyms_path" : "analysis/synonyms.txt",
"updateable": true
}
},
"analyzer": {
"my_synonyms": {
"tokenizer": "keyword",
"filter": [
"lowercase",
"my_synonym_filter"
]
}
}
}
},
"mappings": {
"properties": {
"text_field": {
"type": "text",
"analyzer": "standard",
"search_analyzer": "my_synonyms"
}
}
}
}
But when I try to use the following code in a query I dont get any results.
GET company/_search
{
"query" : {
"query_string" : {
"query" : "(corporation) AND (garage)",
"default_field": "COMBINED_FIELD",
"fuzziness": "AUTO",
"analyzer": "my_synonyms"
}
}
}
Can any of you please help me?