Skip to content

Instantly share code, notes, and snippets.

@jprante
Created March 16, 2015 08:51
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 jprante/da2980446108b5c112a8 to your computer and use it in GitHub Desktop.
Save jprante/da2980446108b5c112a8 to your computer and use it in GitHub Desktop.
Doc values with multi-field
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test' -d '
{
"mappings" : {
"docs" : {
"properties" : {
"content" : {
"type" : "string",
"index" : "not_analyzed",
"doc_values" : true,
"fields" : {
"analyzed_content" : {
"type" : "string",
"analyzer" : "standard"
}
}
}
}
}
}
}
'
curl -XPUT 'localhost:9200/test/docs/1' -d '
{
"content": "Hello World"
}
'
curl -XGET 'localhost:9200/test/_refresh'
curl -XGET 'localhost:9200/test/docs/_search?pretty' -d '
{
"query" : {
"match" : {
"content" : "Hello World"
}
}
}
'
curl -XGET 'localhost:9200/test/docs/_search?pretty' -d '
{
"query" : {
"match" : {
"analyzed_content" : "Hello World"
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment