-
-
Save rmat0n/7b6f4f0398dc5f0966b4 to your computer and use it in GitHub Desktop.
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 -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