# Guidance for using custom analyzers/tokenizers

**URL:** <https://discuss.elastic.co/t/guidance-for-using-custom-analyzers-tokenizers/5956>\
**Category:** Elasticsearch\
**Created:** [November 23, 2011, 7:07pm UTC](https://discuss.elastic.co/t/guidance-for-using-custom-analyzers-tokenizers/5956 "2011-11-23T19:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shane\_Witbeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shane_witbeck/32/2803_2.png) [@Shane\_Witbeck](https://discuss.elastic.co/u/Shane_Witbeck)\
**Post date:** [November 23, 2011, 7:07pm UTC](https://discuss.elastic.co/t/guidance-for-using-custom-analyzers-tokenizers/5956/1 "2011-11-23T19:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 24, 2011, 3:31pm UTC](https://discuss.elastic.co/t/guidance-for-using-custom-analyzers-tokenizers/5956/2 "2011-11-24T15:31:40Z")

</div>

Use the query\_string query for it?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

.

On Wed, Nov 23, 2011 at 9:07 PM, Shane Witbeck [shane@digitalsanctum.com](mailto:shane@digitalsanctum.com)wrote:

> 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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:47am UTC](https://discuss.elastic.co/t/guidance-for-using-custom-analyzers-tokenizers/5956/3 "2017-07-06T03:47:34Z")

</div>


