My dataset in elastic looks like this.
Category | Scat | Sscat | Products | Measure | Price |
---|---|---|---|---|---|
Beverages | Soft Drinks | Cans | Pepsi My Soft Drink 250Ml | 250Ml | 30 |
Household Needs | Laundry Detergents | Detergent Powders | Ariel Matic Top Load Detergent Powder 2Kg | 2Kg | 449 |
Household Needs | Dishwashers | Scrubbers | Gala Sponge Wipe 5 Units | 5 Units | 195 |
Personal Care | Hair Care | Shampoo | Ayush Anti Dandruff Neem Shampoo 330Ml | 330Ml | 199 |
I have mapped data to elastic in following way-
PUT _template/template_1
{
"index_patterns": [
"ubq-*"
],
"settings": {
"index": {
"analysis": {
"filter": {
"whitespace_remove": {
"pattern": " ",
"type": "pattern_replace",
"replacement": ""
}
},
"analyzer": {
"my_analyzer": {
"filter": [
"lowercase",
"whitespace_remove",
"nGram"
],
"type": "custom",
"tokenizer": "keyword"
}
}
},
"number_of_shards": "1"
}
},
"mappings": {
"doc": {
"properties": {
"Index": {
"type": "float",
"index": "true"
},
"Category": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Scat": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Sscat": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Products": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Measure": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Price": {
"type": "float",
"index": "true"
},
"Description": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
},
"Gst": {
"type": "float",
"index": "true"
},
"Url": {
"type": "text",
"index": "true",
"analyzer": "my_analyzer"
}
}
}
},
"aliases": {}
}
}
I am fetching Products
from elastic and displaying in their respective Sscat
in my android app. Im some Sscat
products displayed are fine. But in some Sscat
products are being displayed that do not belong to that sscat. Can someone tell me what I might be doing wrong here?