Skip to content

Instantly share code, notes, and snippets.

@sbeckeriv
Created August 8, 2011 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbeckeriv/1131225 to your computer and use it in GitHub Desktop.
Save sbeckeriv/1131225 to your computer and use it in GitHub Desktop.
Exact matching
Using ES 17.4
I want to get the exact match for matt. I am seeing matt-, matt, matt-cat...
curl -Xget 'http://localhost:9200/g/_search?pretty=true' -d '{"query":{"term": { "username": "matt"}}}'
the mapping # Im using Tire for ruby. I dont know the mapping syntax.
{
"g" : {
"document" : {
"properties" : {
"id" : {
"type" : "long"
},
"username" : {
"type" : "string"
},
}
},
"person" : {
"properties" : {
"username" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment