c# - NEST Elastic Search: Difference between FilterInputs term and terms? -


filterinputs mustfilters; mustfilters &= ms.term("cityid", filterinputs.cities); mustfilters &= ms.terms("cityids", filterinputs.cities); 

what difference between above 2 lines?

as far have tested, second allow multiple cities in document kye cityids. if matches filterinputs.cities=> record returned.

while first allow once city.if matches=>record return else not.

please confirm.

term allows match 1 term. according documentation:

the term query finds documents contain exact term specified in inverted index.

see here

while terms allows specify multiple terms , match of them.it works in in sql . according documentation:

terms query filters documents have fields match of provided terms (not analyzed).

see here


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -