Java & ElasticSearch

(Deepak Goel) #1


I uploaded data of "Shakespeare" in ElasticSearch. The data looks like:

{"type":"line","line_id":7,"play_name":"Antony","speech_number":1,"line_number":"1.1.4","speaker":"KING HENRY IV","text_entry":"To be commenced in strands afar remote."}

I am trying to search this data in Java with the following code:

    SearchResponse searchResponse = client.prepareSearch("shakespeare")
            .setQuery(QueryBuilders.termsQuery("play_name", "Antony"))

However this query does not return any data. Any clues?

Thank You

(David Pilato) #2

Try with antony instead of Antony

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.