'ElasticSearch Grails Plugin keep returning index not found exception

I configure Logstash 5.6.8 to import a csv file to ElasticSearch 5.6.8. In Logstash config file, I put:

output {
    elasticsearch {
        hosts => ["http://localhost:9200"]
        index => "products"
    }
}

Logstach import data correctly to ElasticSearch. I get all documents when I call the api : http://localhost:9200/products/_search?pretty=true&q=: The problem is when I use ElasticSearchService.search in Grails with indice: "products", it always keep returnin index not found exception.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source