Beginners Query Questions

Hi,

On Thu, Feb 3, 2011 at 1:39 PM, dalesrob daviroberts@gmail.com wrote:

Hi,

I'm just looking at the different sorts of queries I can use with the
Java API and I have a couple of questions to clear up.

  1. What is a termQuery used for, how does it differ from a fieldQuery
  • initially I though termQueries were for exact quoted "this exact
    expression" type queries, but now I'm not so sure.

Term queries does not perform any analysis (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/term_query/).
Thus they are for exact matches.
However, field query (
Query DSL | Elasticsearch Guide [8.11] | Elastic)
uses analysis that is setup for this field (or default).

  1. How are filters used in a way that is different from a boolean AND
    search?

Filters do no scoring. So if you can use filter instead of query then you
probably should (much faster and can be cached).

I'm very new to Elasticsearch so any detailled answers to enlighten a
newbie would be much appreciated.

thanks,

David

Regards,
Lukas