Created
April 22, 2014 20:29
-
-
Save ThorstenS/11193188 to your computer and use it in GitHub Desktop.
Elasticsearch fuzzy query
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
curl -XDELETE 'http://localhost:9200/twitter/' | |
curl -XPUT 'http://localhost:9200/twitter/' | |
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d ' | |
{ | |
"user": "kimchy", | |
"postDate": "2009-11-15T13:12:00", | |
"message": "Trying out Elastic Search, so far so good?", | |
"location" : { | |
"lat" : 41.12, | |
"lon" : 8.21 | |
} | |
}' | |
curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d ' | |
{ | |
"user": "kimchy", | |
"postDate": "2009-11-15T14:12:12", | |
"message": "Another tweet, will it be indexed?" , | |
"location" : { | |
"lat" : 50.12, | |
"lon" : 8.34 | |
} | |
}' | |
curl http://localhost:9200/twitter/tweet/_search/?pretty=true -d '{ | |
"query": { | |
"fuzzy": { | |
"user": { | |
"value": "mimchy", | |
"fuzziness": 2 | |
} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment