Can ES do the following?


(Jondow) #1

In evaluating ES as a replacement for our current brute force SQL
search strategy, I need to verify that I can do the following searches
in ES (although I realize this perhaps relates more to Lucene?).

When searching on string value columns in the DB, we offer the
following in our search interface:

  1. Contains any of - this is a whitespace tokenizer search that does
    an OR between the various tokens
  2. Contains all of - this is a whitespace tokenizer search that does
    an AND between the various tokens
  3. Contains exactly - this is a whitespace tokenizer that checks that
    the entire column value matches exactly the token given
  4. Does not contain - this is a whitespace tokenizer that ensures that
    an entity does not contain the given value

#'s 3 and 4 are the main ones I need to verify here. Will those
searches be possible in Lucene vernacular, via ES?

thanks,
Darryl


(Clinton Gormley) #2

On Fri, 2010-11-12 at 07:41 -0800, Jondow wrote:

In evaluating ES as a replacement for our current brute force SQL
search strategy, I need to verify that I can do the following searches
in ES (although I realize this perhaps relates more to Lucene?).

Yes you can

  1. Contains any of - this is a whitespace tokenizer search that does
    an OR between the various tokens
  2. Contains all of - this is a whitespace tokenizer search that does
    an AND between the various tokens
  3. Contains exactly - this is a whitespace tokenizer that checks that
    the entire column value matches exactly the token given
  4. Does not contain - this is a whitespace tokenizer that ensures that
    an entity does not contain the given value

"(some of me) AND must AND have AND this AND "exactly this" NOT excluded"

That's the basic query syntax. On top of that you have and|or|not
filters that you could use on terms that are not analyzed
(eg status: published, user_id: 123 etc)

See here for more:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/

clint


(system) #3