elasticsearch - FilteredQueryBuilder deprecated -
what difference between filteredquerybuilder , queryfilterbuilder both deprecated since 2.0 , alternative java code filteredquerybuilder
filteredquerybuilder filteredquerybuilder = querybuilders.filteredquery(termsquerybuilder, null); queryfilterbuilder queryfilterbuilder = filterbuilders.queryfilter(esquerybuilder);
since queries , filters have been merged, constructs make no sense anymore.
filteredquerybuilder
used create filtered
query, i.e. scored query constrained set of filters. instead of using filteredquerybuilder
, should use
- a
bool/filter
created usingquerybuilders.boolquery().filter(...)
- or
bool/must_not
created usingquerybuilders.boolquery().mustnot(...)
if need negate filter
queryfilterbuilder
used create query
filter, i.e. non-scored query inside filtered context. instead of using queryfilterbuilder
, should now
- use
bool/must
query created usingquerybuilders.boolquery().must(...)
if need , queries - or use
bool/should
created usingquerybuilders.boolquery().should(...)
if need or queries
Comments
Post a Comment