waldemar
(waldemar)
March 22, 2013, 1:54pm
1
Hi All,
I'm trying to execute statistical facet with filter. So I'm using
"facet_filter" without success.
Could you please help me with correct query?
Or maybe there is something else wrong?
My ElasticSearch version is 0.20.2.
My document structure/mapping is:
{"wch1":{"properties":{"HouseCode":{"type":"string"},
"numbers":{"type":"string"},
"period":{"type":"string","index":"not_analyzed",
"omit_norms":true,"index_options":"docs"}}}}
Example document:
{HouseCode:"AB-0013-01", period:["2013-05-23|2013-05-29",
"2013-03-23|2013-06-29", "2013-06-23|2013-06-29"], numbers:",4,71,5,333,"}
My query/facet is:
curl -XGET http://localhost:9200/test_wch/wch1/_search -d '{"facets" : {
"fname" : {"statistical" : {"field":"numbers"} }, "facet_filter" : {"term"
: { "HouseCode" : "ab"}} } } }'
And I get error:
... Parse Failure [No facet type found for [term]]]; }]","status":500}
Please help. Thanks in advance.
Best Regards,
Waldek
--
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 elasticsearch+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
waldemar
(waldemar)
March 22, 2013, 1:58pm
2
PS. In this example numbers are as string, but even when they are set as an
array of numbers query also not working, and I've got the same error.
--
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 elasticsearch+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Subject: Re: facet_filter simple example not working
Date: Mon, 25 Mar 2013 19:43:20 +0100
My query/facet is:
curl -XGET http://localhost:9200/test_wch/wch1/_search -d '{"facets" :
{ "fname" : {"statistical" : {"field":"numbers"} }, "facet_filter" :
{"term" : { "HouseCode" : "ab"}} } } }'
And I get error:
... Parse Failure [No facet type found for [term]]]; }]","status":500}
If you pretty-print your JSON, you will see that your facet_filter is at
the wrong level. It should be like this:
{
"facets" : {
"fname" : {
"statistical" : {
"field":"numbers"
}
"facet_filter" : {
"term" : {
"HouseCode" : "ab"
}
}
}
}
}
}
clint
--
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 elasticsearch+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .