Skip to content

Instantly share code, notes, and snippets.

@BenHall
Last active August 29, 2015 14:05
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 BenHall/278632192d0dc6407a2c to your computer and use it in GitHub Desktop.
Save BenHall/278632192d0dc6407a2c to your computer and use it in GitHub Desktop.
ElasticSearch bug with dots in document type?
curl -XPUT 'http://localhost:9200/twitter/twee.t/1' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elasticsearch"
}'
curl -X GET 'http://localhost:9200/twitter/_search?q=user:kimchy'
curl -X GET 'http://localhost:9200/twitter/twee.t/_search?q=user:kimchy'
curl -X GET 'http://localhost:9200/twitter/tw*/_search?q=user:kimchy'
@BenHall
Copy link
Author

BenHall commented Aug 11, 2014

First two work and return data, the third doesn't but should according to wildcards. http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/multi-index-multi-type.html

@polyfractal
Copy link

curl -XGET "http://localhost:9200/twitter/_search" -d'
{
    "query": {
        "filtered": {
           "filter": {
               "regexp": {
                   "_type": {
                      "value": "tw.*"
                   }
                }
           }
        }
    }
}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment