Skip to content

Instantly share code, notes, and snippets.

@rmat0n
Last active August 29, 2015 14:07
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 rmat0n/7b6f4f0398dc5f0966b4 to your computer and use it in GitHub Desktop.
Save rmat0n/7b6f4f0398dc5f0966b4 to your computer and use it in GitHub Desktop.
curl -XPUT 'http://localhost:9200/exists/'
curl -XPUT 'http://localhost:9200/exists/obj1/_mapping' -d '{
"obj1": {
"properties": {
"testtext": {
"type": "string",
"index_name": "1.testtext",
"analyzer": "standard"
}
}
}
}'
curl -XPUT 'http://localhost:9200/exists/obj2/_mapping' -d '{
"obj2": {
"properties": {
"testtext": {
"type": "string",
"index_name": "2.testtext",
"analyzer": "standard"
}
}
}
}'
curl -XPUT localhost:9200/exists/obj1/1 -d '{ "id": "1", "testtext": [ "foo" ]}'
curl -XPUT localhost:9200/exists/obj2/2 -d '{ "id": "2", "testtext": [ "bar" ]}'
GET _search
{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "_exists_: testtext"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment