Elastic Search - Not giving the correct search result when bulk inserting data

Viewed 33

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.

  1. 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" }

     }
    

    } }

  2. 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" }

  3. 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
    }

  4. It gives me the expected result.

  5. 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.

  6. 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?

0 Answers
Related