Last active
March 10, 2018 18:15
-
-
Save yogeshsr/0d1075c1d1e13d83444a695adf783d8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -XPOST 'localhost:9200/coupon/_search?pretty' -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"bool": { | |
"should": [ | |
{"match": {"sponsor": {"query": "rent car in Bangalore"} } }, | |
{"match": {"title": {"query": "rent car in Bangalore"} } }, | |
{"match": {"description": {"query": "rent car in Bangalore"} } } ] } | |
} | |
}' | |
: ' ------ Query Results ------ ------ ------ | |
{ | |
"took" : 2, | |
"timed_out" : false, | |
"_shards" : {"total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits" : {"total" : 1, "max_score" : 3.7239065, | |
"hits" : [ | |
{ | |
"_index" : "coupon", | |
"_type" : "doc", | |
"_id" : "Oa8BEWIBvUnpi3ncbsdf", | |
"_score" : 3.7239065, | |
"_source" : { | |
"id" : "dcaf7d50-b6d1-413b-b52f-36d0288013e2", | |
"sponsor" : "ZoomCar", | |
"title" : "GrabOn - ZoomCar WeekEnd Exclusive Offer: Flat 20% Off On Self Drives (All Days)", | |
"description" : "Verified on 10 Mar 2018. This Festive Season Zoomcar brings an amazing discount of 20% on your bookings. The maximum discount is Rs 1000. This offer is available in all serviceable cities. Zoomcar is an online service providing car rental for self driven cars across India. Book self drive cars at just on go. The offer is active in: Bangalore, Pune, Delhi, Chennai, Hyderabad, Chandigarh, Kolkata, Ahmedabad, Mysore, Vizag, Jaipur, Mangalore, Coimbatore, and Ludhiana. The discount is only applicable only on original reservation charges (not applicable on excess Km, late return fee, or other fees/charges). A fully refundable security deposit will be charged at the time of booking. Only valid on bookings made through Zoomcar website." | |
} | |
} | |
] | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment