# Query time synonyms application

**URL:** <https://discuss.elastic.co/t/query-time-synonyms-application/13265>\
**Category:** Elasticsearch\
**Created:** [August 20, 2013, 8:39am UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265 "2013-08-20T08:39:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kul/32/2158_2.png) [@kul](https://discuss.elastic.co/u/kul)\
**Post date:** [August 20, 2013, 8:39am UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/1 "2013-08-20T08:39:03Z")

</div>

Is it possible to apply synonyms at query time? Or any other method to  
avoid reindexing the whole data again with change in synonym definitions ?

for myuse case, typical synonyms looks like

camelcase =\> CamelCase  
GAPS, gaps =\> Gaps  
Barca =\> Barcelona

Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 20, 2013, 3:31pm UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/2 "2013-08-20T15:31:08Z")

</div>

yes you can have a query time analyzer in your mapping "search\_analyzer"  
which can be changed without reindexing. you can just use synonyms as query  
time instead of index time.

simon

On Tuesday, August 20, 2013 10:39:03 AM UTC+2, kul wrote:

> Is it possible to apply synonyms at query time? Or any other method to  
> avoid reindexing the whole data again with change in synonym definitions ?
> 
> for myuse case, typical synonyms looks like
> 
> camelcase =\> CamelCase  
> GAPS, gaps =\> Gaps  
> Barca =\> Barcelona
> 
> Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![kul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kul/32/2158_2.png) [@kul](https://discuss.elastic.co/u/kul)\
**Post date:** [August 21, 2013, 10:21am UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/3 "2013-08-21T10:21:17Z")

</div>

Very nice!

Thanks Simon.

Also, I looked around but could not find anything on how to make the change  
to synonym file take effect?  
For small no. of records i can see that it takes effect immediately after  
restart of es server,  
But for large no. of records i do not see synonym being applied even after  
restart.

Thanks

On Tuesday, August 20, 2013 9:01:08 PM UTC+5:30, simonw wrote:

> yes you can have a query time analyzer in your mapping "search\_analyzer"  
> which can be changed without reindexing. you can just use synonyms as query  
> time instead of index time.
> 
> simon
> 
> On Tuesday, August 20, 2013 10:39:03 AM UTC+2, kul wrote:
> 
> > Is it possible to apply synonyms at query time? Or any other method to  
> > avoid reindexing the whole data again with change in synonym definitions ?
> > 
> > for myuse case, typical synonyms looks like
> > 
> > camelcase =\> CamelCase  
> > GAPS, gaps =\> Gaps  
> > Barca =\> Barcelona
> > 
> > Thanks

--  
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).  
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:** [August 21, 2013, 11:28pm UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/4 "2013-08-21T23:28:17Z")

</div>

If you are using synonyms at query time, any changes to the synonym file  
should take into effect after a restart. Can you share your analyzer  
configuration?

--  
Ivan

On Wed, Aug 21, 2013 at 3:21 AM, kul [kuldeep.bora@gmail.com](mailto:kuldeep.bora@gmail.com) wrote:

> Very nice!
> 
> Thanks Simon.
> 
> Also, I looked around but could not find anything on how to make the  
> change to synonym file take effect?  
> For small no. of records i can see that it takes effect immediately after  
> restart of es server,  
> But for large no. of records i do not see synonym being applied even after  
> restart.
> 
> Thanks
> 
> On Tuesday, August 20, 2013 9:01:08 PM UTC+5:30, simonw wrote:
> 
> > yes you can have a query time analyzer in your mapping "search\_analyzer"  
> > which can be changed without reindexing. you can just use synonyms as query  
> > time instead of index time.
> > 
> > simon
> > 
> > On Tuesday, August 20, 2013 10:39:03 AM UTC+2, kul wrote:
> > 
> > > Is it possible to apply synonyms at query time? Or any other method to  
> > > avoid reindexing the whole data again with change in synonym definitions ?
> > > 
> > > for myuse case, typical synonyms looks like
> > > 
> > > camelcase =\> CamelCase  
> > > GAPS, gaps =\> Gaps  
> > > Barca =\> Barcelona
> > > 
> > > Thanks
> > 
> > --  
> > 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).  
> > 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![sina\_tamanna](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sina\_tamanna](https://discuss.elastic.co/u/sina_tamanna)\
**Post date:** [August 22, 2013, 7:31am UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/5 "2013-08-22T07:31:01Z")

</div>

I'm wondering if you really need synonyms like "camelcase =\> CamelCase",  
and "GAPS, gaps =\> Gaps"? Just using a lowercase filter will give you hits  
on these documents.

--  
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).  
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:20am UTC](https://discuss.elastic.co/t/query-time-synonyms-application/13265/6 "2017-07-06T02:20:14Z")

</div>


