I'm a new user, so hopefully this is something really simple. I have two
"message" objects in my index, "typeA" and "typeB", each of which has a
"net" field. I'd like to be able to search for all objects whose net fields
match a pattern.

If I specify the fields explicitly, the query returns the appropriate docs.
If I use a wildcard in the fields for the query_string, the query returns no
hits. Clearly I don't understand something - can anyone point out what I'm
missing?

curl -XPUT localhost:9200/nettest/message/typeA-1 -d '{
    "typeA" : {
        "net" : "NET11_TEST"
    }
}'

curl -XPUT localhost:9200/nettest/message/typeB-1 -d '{
    "typeB" : {
        "net" : "NET01_TEST"
    }
}'

This query returns both docs:
curl -XGET localhost:9200/nettest/_search?pretty=true -d '{
    "query" : {
        "query_string" : {
            "fields" : ["message.typeA.net", "message.typeB.net"],
            "query" : "NET*"
        }
    }
}'        

This query returns no docs:
curl -XGET localhost:9200/nettest/_search?pretty=true -d '{
    "query" : {
        "query_string" : {
            "fields" : ["message.*.net"],
            "query" : "NET*"
        }
    }
}'



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/Using-wildcards-in-query-string-fields-tp4055594.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1399573144796-4055594.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to