I would like to apply snowball analyser to search the data however today I got a very strange issue. Let me explain step by step.
I have created the below index using kibana development tool
PUT test_index_version_1 { "settings": { "number_of_shards": 5, "analysis": { "analyzer": { "ana_tenderinfo": { "tokenizer": "standard", "filter": ["lowercase","snowball"] } } } }, "mappings": { "properties": { "workDesc" : { "type": "text", "analyzer": "ana_tenderinfo" }
}} }
I have inserted dummy data using kibana
POST test_index_version_1/_doc { "workDesc" : "he works hard today" }
POST test_index_version_1/_doc { "workDesc" : "I worked yesterday" }
POST test_index_version_1/_doc { "workDesc" : "work" }
POST test_index_version_1/_doc { "workDesc" : "I am working" }
Now I search the result using the below query
GET test_index_version_1/_search { "query": { "bool": { "must":[ { "intervals": { "workDesc":{ "match":{ "query":"working", "max_gaps":5
} } } } ]}
}, "size":10
}It gives me the expected result.
But search query is not giving the correct result when a. I created an index using kibana b. Transferred the bulk data from SQL server to elastic search using bulk API.
Even more strange thing is, a. I created an index using kibana, b. Added dummy data using kibana and c. Transferred the bulk data from SQL server d. Then the search query gives the proper result. Can anyone give any explanation for the above strange behavior?