Document search

Since we have documents in our my_index index, we can search these documents:

Find out a document where city = " Los Angeles? and query is as follows:

curl -XGET 'http://localhost:9200/my_index2/_search?pretty' -H 'Content-Type: application/json' -d' {"query": {"match": {"city": "Los Angeles" }}}'

Response:

{"took" : 3,"timed_out" : false,"_shards" : {"total" : 3,"successful" : 3,"skipped" : 0,"failed" : 0},"hits" : {"total" : 1,"max_score" : 1.3862944,"hits" : [{"_index" : "my_index","_type" : "customer","_id" : "3","_score" : 1.3862944,"_source" : {"name" : "Dan Lee","birthdate" : "1970-01-25","street" : "76336 1st Street","city" : "Los Angeles","state" : "ca","postalCode" : "90010","homePhone" : "323-892-5363","cellPhone" ...

Get Modern Big Data Processing with Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.