Difference between Filter and Query


(OhNo) #1

Hey all,

i have a object e.g. person which have a Date field "birthday". Now i want do a query (via java api) which returns me all persons who have birthday at 01.01.1960. I always get

"SearchParseException[[persons][4]: from[-1],size[1000]: Parse Failure [Failed to parse source [{"size":1000,"query":{"bool":{"should":{"field":{"birthday":"2012-03-22T23:00:00.000Z"}}}}}]]]; nested: QueryParsingException[[catalogue] Failed to parse query [2012-03-22T23:00:00.000Z]];"

So i googled and found that maybe i should use a FILTER instead of a query (or with a matchAll query).

But acutally i didnĀ“t find an explanation when to use a filter and when a query condition.

Finally i just want get all persons who have birthday at 01.01.1960, by the way NO range condition.

Thanks for any help!
OhNo


(system) #2