Created
October 28, 2016 13:10
-
-
Save eskibars/2a1e91454eb4fc4a88860cc80ea09acd to your computer and use it in GitHub Desktop.
Not analyzed example
This file contains hidden or 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
// Add our mapping for type "type_name" to index "t" | |
PUT t | |
{ | |
"mappings": { | |
"type_name" : { | |
"dynamic_templates": [{ | |
"notanalyzed" : { | |
"match": "*", | |
"mapping": { | |
"index": "not_analyzed" | |
} | |
} | |
}] | |
} | |
} | |
} | |
// Add a document to index "t" and type "type_name" | |
PUT t/type_name/1 | |
{ | |
"baz": "foo bar" | |
} | |
// This produces 0 results | |
GET t/_search | |
{ | |
"query": { | |
"match": { | |
"baz": "bar" | |
} | |
} | |
} | |
// This produces 1 result | |
GET t/_search | |
{ | |
"query": { | |
"match": { | |
"baz": "foo bar" | |
} | |
} | |
} | |
// This produces 1 result as well | |
GET t/_search | |
{ | |
"query": { | |
"term": { | |
"baz": "foo bar" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment