Here's a snippet:
{"took":17,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":}}Holden:logs
warnero$ curl -XGET 'localhost:9200/syncrswim/_search' -d
'{"query":{"filtere"query_string" : {"query" : "Teach","fields" : [
"title", "description" ]}}}}}'
{"took":37,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":1,"max_score":0.18167211,"hits":[{"_index":"syncrswim","_type":"syncrswim","_id":"3283712673","_score":0.18167211,
"_source" : {"tags":["meditation"],
"docType":"Event",
"lastUpdated":"2012-05-13 14:30:36",
So, you can see docType is uppercase Event. I'm just using a default
analyzer (no customizations).
-warner
On Tue, Jun 12, 2012 at 1:15 AM, Anne Veling anne@beyondtrees.com wrote:
Can you give the json output of one of the documents you expect to be
returned for this query? What is the exact value of the "docType" field for
that document?
Also, how is that field analyzed? Could it be that it has a StandardAnalyzer
and is lowercased ("event")?
Anne
On Tue, Jun 12, 2012 at 4:48 AM, Warner Onstine warnero@gmail.com wrote:
Ok, now that I finally have some stuff working I'm trying to figure
out why my filtered query is returning 0 records.
Here's my query:
{"query": {
"filtered" : {
"query_string" : {
"fields": ["description", "title"],
"query" : "Understanding"
},
"filter" : {
"term" : {
"docType" : "Event"
}
}
}
}
}
If I remove the filter portion it returns the records (who have the
docType fieild and the appropriate value of "Event").
Originally I didn't have the doctype in my mapping so I added it, but
it didn't help :/.
Any ideas? Been searching but don't see a lot of examples on filtered
queries on the web.
Thanks in advance.
-warner
--
Anne Veling
BeyondTrees.com
+31 6 50 969 170
@anneveling