# How we can use different analyzers for one field.(At a time only one analyzer we will use in search but, search requirement is differ)

**URL:** https://discuss.elastic.co/t/how-we-can-use-different-analyzers-for-one-field-at-a-time-only-one-analyzer-we-will-use-in-search-but-search-requirement-is-differ/18093
**Category:** Elasticsearch
**Created:** [June 13, 2014, 10:02am UTC](https://discuss.elastic.co/t/how-we-can-use-different-analyzers-for-one-field-at-a-time-only-one-analyzer-we-will-use-in-search-but-search-requirement-is-differ/18093 "2014-06-13T10:02:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sowjanya](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sowjanya](https://discuss.elastic.co/u/sowjanya)
#### Post date: [June 13, 2014, 10:02am UTC](https://discuss.elastic.co/t/how-we-can-use-different-analyzers-for-one-field-at-a-time-only-one-analyzer-we-will-use-in-search-but-search-requirement-is-differ/18093/1 "2014-06-13T10:02:15Z")

</div>

Hi,  
I have below Requirement. Please help me.

I am using _elasticsearch-1.1.0_

- In Index, I have n no.of Fields. and m no.of Types
- Eg: Types: Person,Book
- Eg: Fields:
- Person: Name,age,Email,Phone
- Book: Name,author,price
- How to set the analyzers to all Fields and all types.

## _My Search Requirement:_ Input: Person: Name: john smith age:30 Email: [john@gmail.com](mailto:john@gmail.com) Phone: (987) 123-4567

## Name: John Smith age:30 Email: [john@gmail.com](mailto:john@gmail.com) Phone: (879) 123-4567

## Name: django$haystack age:30 Email: [john@gmail.com](mailto:john@gmail.com) Phone: (987) 123-4567

Name: django#haystack  
age:30  
Email: [john@gmail.com](mailto:john@gmail.com)  
Phone: (987) 123-4567

_Scenario1:_  
_Search String_ : django#haystack  
_Results_: django$haystack,django#haystack  
But, We are expected Result is _django#haystack_

_Scenario2:_  
\*Search String: \*John Smith  
_Results_: John Smith,john smith  
Expected Results are John Smith  
_Scenario3:_  
\*Search String: \*John Smith  
_Results_: John Smith,john smith  
_It is fine. But, we need to support Scenario2 also. How we can support  
Scenario2 and Scenario3 using analyzers._

_Please Help me in this._

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ef287049-2c3a-4862-b077-82bf3cb63a9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef287049-2c3a-4862-b077-82bf3cb63a9e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:22am UTC](https://discuss.elastic.co/t/how-we-can-use-different-analyzers-for-one-field-at-a-time-only-one-analyzer-we-will-use-in-search-but-search-requirement-is-differ/18093/2 "2017-07-06T01:22:46Z")

</div>


