Hi,
I have mapped an index as follows
PUT test
{
"settings": {
"index": {
"number_of_shards": 1,
"analysis": {
"analyzer": {
"english": {
"tokenizer": "standard",
"filter": ["trim", "lowercase", "english_possessive_stemmer", "my_stop", "light_english_stemmer","shingle"]
}
},
"filter": {
"english_possessive_stemmer":{
"type" : "stemmer",
"language" : "possessive_english"
},
"light_english_stemmer":{
"type" : "stemmer",
"language" : "light_english"
},
"my_stop":{
"type" : "stop",
"stopwords" : ["what", "is"],
"remove_trailing" : "false"
}
}
}
}
},
"mappings": {
"test": {
"properties": {
"title": {
"type": "text",
"analyzer": "english"
}
}
}
}
}
And inserted following documents
POST test/test?refresh=true
{"title": "hilton colombo"}
POST test/test?refresh=true
{"title": "colombo hilton"}
Now when I search for "what is hilton colombo" I do not get any results.
GET test/test/_search
{
"query": {
"match": {
"title": {
"query": "what is hilton colombo",
"analyzer": "english",
"operator": "and"
}
}
}
}
But when I analyze the query I can see the "hilton colombo" as a token
GET test/_analyze
{
"analyzer": "english",
"text": "what is hilton colombo"
}
Shouldn't the search analyzer remove any stop words and match the rest of the words against the document titles?
What am I missing here?
Can anyone please help me to figure this one out? Thank you