# Query- or index-time synonym expansion

**URL:** <https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811>\
**Category:** Elasticsearch\
**Created:** [December 11, 2013, 9:52am UTC](https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811 "2013-12-11T09:52:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 11, 2013, 9:52am UTC](https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811/1 "2013-12-11T09:52:46Z")

</div>

Can somebody point me to Query time synonym expansion mapping and  
index-time synonym expansion mapping .

My mapping is as below

{  
"settings": {  
"analysis": {  
"analyzer": {  
"synonym": {  
"tokenizer": "whitespace",  
"filter": [  
"standard",  
"lowercase",  
"syns\_filter"  
]  
}  
},  
"filter": {  
"syns\_filter": {  
"synonyms\_path": "synonyms/synonym\_country.txt",  
"type": "synonym"  
}  
}  
}  
},  
"mappings": {  
"hometwo": {  
"properties": {  
"name": {  
"type": "string",  
"analyzer": "synonym"  
}  
}  
}  
}  
}

how to know it is query time analyzer or index time analyzer.

--  
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/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 11, 2013, 11:06pm UTC](https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811/2 "2013-12-11T23:06:07Z")

</div>

If you use the "analyzer" parameter, then it will be used at both indexing  
and query time. You can specify the specific analyzers via index\_analyzer  
and search\_analyzer

> **[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.

--  
Ivan

On Wed, Dec 11, 2013 at 1:52 AM, paul [avinashpaul85@gmail.com](mailto:avinashpaul85@gmail.com) wrote:

> Can somebody point me to Query time synonym expansion mapping and  
> index-time synonym expansion mapping .
> 
> My mapping is as below
> 
> {  
> "settings": {  
> "analysis": {  
> "analyzer": {  
> "synonym": {  
> "tokenizer": "whitespace",  
> "filter": [  
> "standard",  
> "lowercase",  
> "syns\_filter"  
> ]  
> }  
> },  
> "filter": {  
> "syns\_filter": {  
> "synonyms\_path": "synonyms/synonym\_country.txt",  
> "type": "synonym"  
> }  
> }  
> }  
> },  
> "mappings": {  
> "hometwo": {  
> "properties": {  
> "name": {  
> "type": "string",  
> "analyzer": "synonym"  
> }  
> }  
> }  
> }  
> }
> 
> how to know it is query time analyzer or index time analyzer.
> 
> --  
> 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/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CALY%3DcQBc17iXRB6P%3DrVhnNqo5gsEufb5ciAAO7sRFdjCeoRoaw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBc17iXRB6P%3DrVhnNqo5gsEufb5ciAAO7sRFdjCeoRoaw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 12, 2013, 4:37am UTC](https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811/3 "2013-12-12T04:37:52Z")

</div>

Thank you for the clarification , will read through the link.

-paul

On Thu, Dec 12, 2013 at 4:36 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> If you use the "analyzer" parameter, then it will be used at both indexing  
> and query time. You can specify the specific analyzers via index\_analyzer  
> and search\_analyzer
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html)
> 
> --  
> Ivan
> 
> On Wed, Dec 11, 2013 at 1:52 AM, paul [avinashpaul85@gmail.com](mailto:avinashpaul85@gmail.com) wrote:
> 
> > Can somebody point me to Query time synonym expansion mapping and  
> > index-time synonym expansion mapping .
> > 
> > My mapping is as below
> > 
> > {  
> > "settings": {  
> > "analysis": {  
> > "analyzer": {  
> > "synonym": {  
> > "tokenizer": "whitespace",  
> > "filter": [  
> > "standard",  
> > "lowercase",  
> > "syns\_filter"  
> > ]  
> > }  
> > },  
> > "filter": {  
> > "syns\_filter": {  
> > "synonyms\_path": "synonyms/synonym\_country.txt",  
> > "type": "synonym"  
> > }  
> > }  
> > }  
> > },  
> > "mappings": {  
> > "hometwo": {  
> > "properties": {  
> > "name": {  
> > "type": "string",  
> > "analyzer": "synonym"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > how to know it is query time analyzer or index time analyzer.
> > 
> > --  
> > 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/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd5b3726-cd96-4d61-8f8f-3b3a4d823c48%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/o1yaa0KoWX8/unsubscribe](https://groups.google.com/d/topic/elasticsearch/o1yaa0KoWX8/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CALY%3DcQBc17iXRB6P%3DrVhnNqo5gsEufb5ciAAO7sRFdjCeoRoaw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBc17iXRB6P%3DrVhnNqo5gsEufb5ciAAO7sRFdjCeoRoaw%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAO066G00pCxxi4jn\_84UE974gXD0R9XK7RYMqjwOKx\_CKG3zcw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO066G00pCxxi4jn_84UE974gXD0R9XK7RYMqjwOKx_CKG3zcw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:01am UTC](https://discuss.elastic.co/t/query-or-index-time-synonym-expansion/14811/4 "2017-07-06T02:01:47Z")

</div>


