My dictionary is below, I have loaded the cluster
[
{'id':1, 'name': 'weather report', 'description': 'Today is cooler weather'},
{'id':2, 'name': 'weather report', 'description': 'Today is hotter weather'},
{'id':3, 'name': 'weather report', 'description': 'Today is warm weather'}
]
I loaded the cluster
for i in wea:
es.index(index="wea", body=i, id=i['id'])
- I am searching for hot*
- I have stop words hotter
- so in the output there is no content
Below is the code
es.indices.close("wea")
settings = {
"settings": {
"analysis": {
"analyzer": {
"blogs_analyzer": {
"type": "standard",
"stopwords": [
"hotter"
]
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "text",
"analyzer": "blogs_analyzer"
},
"name": {
"type": "text",
"analyzer": "blogs_analyzer"
},
"description": {
"type": "text",
"analyzer": "blogs_analyzer"
}
}
}
}
# es.indices.create(index="wea", ignore=400, body=settings)
es.indices.put_settings(index="wea", body=settings)
es.indices.open("wea")
- The above scenario is perfectly working fine. now the problem
If i am changing my stopwords from 'hotter' to 'cooler' and i am searching cool* then my output has to be empty.
but I am getting {'id':3, 'name': 'weather report', 'description': 'Today is cooler weather'}
I found one solution i have to reload the cluster? Is that correct approach? any way to achieve without reloading