Created
November 22, 2012 16:36
-
-
Save mauricioalarcon/4132033 to your computer and use it in GitHub Desktop.
simple text search
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
# Inserting a pckg | |
curl -X POST localhost:9200/pckgs/pckg/1 -d '{ | |
"pckg" : { | |
"title" : "Rio de Janeiro", | |
"shuttleService": "NOTINC", | |
"published" : "true", | |
} | |
}' | |
# Checking it's there | |
curl -X GET localhost:9200/pckgs/_search?pretty=true | |
# Search by shuttleService = NOTINC | |
curl -X GET localhost:9200/pckgs/_search?pretty=true -d '{ | |
"query": { | |
"filtered" : { | |
"query" : { | |
"match_all" : {} | |
}, | |
"filter" : { | |
"term" : { "shuttleService" : "NOTINC" } | |
} | |
} | |
} | |
}' | |
# my other attempt | |
curl -X GET localhost:9200/pckgs/_search?pretty=true -d '{ | |
"query" : { | |
"term" : {"shuttleService" : "NOTINC"} | |
} | |
}' | |
# response for both searches below | |
# | |
# "hits" : { | |
# "total" : 0, | |
# "max_score" : null, | |
# "hits" : [ ] | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment