Guidance for using custom analyzers/tokenizers


(Shane Witbeck) #1

My ES project is coming along nicely but now I'd like more robust searches.

Given a single search field, perform logical AND's or OR's using a
combination of the following:

  1. quoted exact phrase searches. for example "this is a test"
  2. prefixes such as "wiki:foo" or "-wiki:foo" which will include or
    exclude "foo" in documents of type "wiki"
  3. if only a single number is entered, then do a term search on a
    specific field.

I'd like to leverage ES's out-of-the-box functionality as much as possible.

What's the best way to do the above customizations using the Java API?

Thanks


(Shay Banon) #2

Use the query_string query for it?
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html
.

On Wed, Nov 23, 2011 at 9:07 PM, Shane Witbeck shane@digitalsanctum.comwrote:

My ES project is coming along nicely but now I'd like more robust searches.

Given a single search field, perform logical AND's or OR's using a
combination of the following:

  1. quoted exact phrase searches. for example "this is a test"
  2. prefixes such as "wiki:foo" or "-wiki:foo" which will include or
    exclude "foo" in documents of type "wiki"
  3. if only a single number is entered, then do a term search on a
    specific field.

I'd like to leverage ES's out-of-the-box functionality as much as possible.

What's the best way to do the above customizations using the Java API?

Thanks


(system) #3