I have created an index using the following mapping.
PUT _template/template_1
{
"index_patterns": [
"ubq-*"
],
"settings": {
"index": {
"analysis": {
"analyzer": {
"my_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "keyword",
"remove_trailing": "false"
}
}
},
"number_of_shards": "1"
}
},
"mappings": {
"doc": {
"properties": {
"Index": {
"type": "float",
"index": "true"
},
"Category": {
"type": "keyword",
"index": "true"
},
"Scat": {
"type": "keyword",
"index": "true"
},
"Sscat": {
"type": "keyword",
"index": "true"
},
"Products": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Measure": {
"type": "keyword",
"index": "true"
},
"Price": {
"type": "float",
"index": "true"
},
"Description": {
"type": "keyword",
"index": "true"
},
"Gst": {
"type": "float",
"index": "true"
},
"Url": {
"type": "keyword",
"index": "true"
}
}
}
},
"aliases": {}
}
I am getting random search results until i give a space. Please look in the images below!
In above image you can see search result displaying random products.
But giving a space after sugar displays the correct products.
1)How can i fix this issue so when i type sugar i see sugar?
2) When i search for products that are not availabe in my index, elastic is still returning some results, how to make sure elastic doesn't return any result when product is not found?