# Keyword Map

**URL:** <https://discuss.elastic.co/t/keyword-map/9102>\
**Category:** Elasticsearch\
**Created:** [September 21, 2012, 9:32pm UTC](https://discuss.elastic.co/t/keyword-map/9102 "2012-09-21T21:32:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![banderon1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/banderon1/32/2689_2.png) [@banderon1](https://discuss.elastic.co/u/banderon1)\
**Post date:** [September 21, 2012, 9:32pm UTC](https://discuss.elastic.co/t/keyword-map/9102/1 "2012-09-21T21:32:37Z")

</div>

I have two text fields that are indexed (name and description), and when a  
query is executed, I want to be able to search for certain keywords based  
on the query. For example, if I search for "kleenex", I also want it to  
search for "facial tissue". I have hundreds/thousands of keywords to map,  
what is the right way to do this?

--

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [September 22, 2012, 2:09am UTC](https://discuss.elastic.co/t/keyword-map/9102/2 "2012-09-22T02:09:19Z")

</div>

Hi,

It sounds like you may be looking for synonyms?

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Friday, September 21, 2012 5:32:37 PM UTC-4, banderon1 wrote:

> I have two text fields that are indexed (name and description), and when a  
> query is executed, I want to be able to search for certain keywords based  
> on the query. For example, if I search for "kleenex", I also want it to  
> search for "facial tissue". I have hundreds/thousands of keywords to map,  
> what is the right way to do this?

--

---

<div class="post-metadata">

**Author:** ![banderon1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/banderon1/32/2689_2.png) [@banderon1](https://discuss.elastic.co/u/banderon1)\
**Post date:** [September 25, 2012, 9:57pm UTC](https://discuss.elastic.co/t/keyword-map/9102/3 "2012-09-25T21:57:19Z")

</div>

Thanks, Otis, this looks like the correct path, but I'm still not getting  
proper results. I am trying to add the synonyms filter when adding items to  
my index. I seem to have the proper syntax (copy & pasted from the  
example), but when I add documents (bulk), I don't see any change to my  
index. And when I search, it doesn't appear to have any change. How can I  
tell if the synonyms filter is being implemented on my index?

On Fri, Sep 21, 2012 at 7:09 PM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hi,
> 
> It sounds like you may be looking for synonyms?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/synonym-tokenfilter.html)
> 
> ## Otis
> 
> Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)
> 
> On Friday, September 21, 2012 5:32:37 PM UTC-4, banderon1 wrote:
> 
> > I have two text fields that are indexed (name and description), and when  
> > a query is executed, I want to be able to search for certain keywords based  
> > on the query. For example, if I search for "kleenex", I also want it to  
> > search for "facial tissue". I have hundreds/thousands of keywords to map,  
> > what is the right way to do this?
> 
> --

--

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [September 26, 2012, 3:23am UTC](https://discuss.elastic.co/t/keyword-map/9102/4 "2012-09-26T03:23:07Z")

</div>

Hi,

You could peek at your index and see if your synonyms are getting indexed.  
The skywalker plugin should let you do that.

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Tuesday, September 25, 2012 5:57:27 PM UTC-4, banderon1 wrote:

> Thanks, Otis, this looks like the correct path, but I'm still not getting  
> proper results. I am trying to add the synonyms filter when adding items to  
> my index. I seem to have the proper syntax (copy & pasted from the  
> example), but when I add documents (bulk), I don't see any change to my  
> index. And when I search, it doesn't appear to have any change. How can I  
> tell if the synonyms filter is being implemented on my index?
> 
> On Fri, Sep 21, 2012 at 7:09 PM, Otis Gospodnetic \<[otis.gos...@gmail.com](mailto:otis.gos...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi,
> > 
> > It sounds like you may be looking for synonyms?
> > 
> > [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/synonym-tokenfilter.html)
> > 
> > ## Otis
> > 
> > Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> > Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)
> > 
> > On Friday, September 21, 2012 5:32:37 PM UTC-4, banderon1 wrote:
> > 
> > > I have two text fields that are indexed (name and description), and when  
> > > a query is executed, I want to be able to search for certain keywords based  
> > > on the query. For example, if I search for "kleenex", I also want it to  
> > > search for "facial tissue". I have hundreds/thousands of keywords to map,  
> > > what is the right way to do this?
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![banderon1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/banderon1/32/2689_2.png) [@banderon1](https://discuss.elastic.co/u/banderon1)\
**Post date:** [September 26, 2012, 4:19pm UTC](https://discuss.elastic.co/t/keyword-map/9102/5 "2012-09-26T16:19:51Z")

</div>

Thanks for introducing me to the skywalker plugin, this looks pretty cool!  
I've been testing my data all morning, and cannot get these indices working  
with synonyms ☹ Here is what I have added to my index before creating it:

{"analysis":{"analyzer":{"synonym":{"tokenizer":"whitespace","filter":["synonym"]}},"filter":{"synonym":{"type":"synonym","synonyms":["embriodery  
, embroidery"]}}}}

And here is what skywalker shows is in my index (I've only added 1 item to  
the index for simplicity, which happens to have the term "embriodery" in  
one of the text fields).

[http://pastebin.com/Ut0chNP1](http://pastebin.com/Ut0chNP1)

No mention of synonyms, which is what I was hoping for... Any ideas?

On Tue, Sep 25, 2012 at 8:23 PM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hi,
> 
> You could peek at your index and see if your synonyms are getting indexed.  
> The skywalker plugin should let you do that.
> 
> ## Otis
> 
> Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)
> 
> On Tuesday, September 25, 2012 5:57:27 PM UTC-4, banderon1 wrote:
> 
> > Thanks, Otis, this looks like the correct path, but I'm still not getting  
> > proper results. I am trying to add the synonyms filter when adding items to  
> > my index. I seem to have the proper syntax (copy & pasted from the  
> > example), but when I add documents (bulk), I don't see any change to my  
> > index. And when I search, it doesn't appear to have any change. How can I  
> > tell if the synonyms filter is being implemented on my index?
> > 
> > On Fri, Sep 21, 2012 at 7:09 PM, Otis Gospodnetic [otis.gos...@gmail.com](mailto:otis.gos...@gmail.com)wrote:
> > 
> > > Hi,
> > > 
> > > It sounds like you may be looking for synonyms?  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/index-modules/)\*\*  
> > > analysis/synonym-tokenfilter.\*\*html[http://www.elasticsearch.org/guide/reference/index-modules/analysis/synonym-tokenfilter.html](http://www.elasticsearch.org/guide/reference/index-modules/analysis/synonym-tokenfilter.html)
> > > 
> > > ## Otis
> > > 
> > > Search Analytics - [http://sematext.com/search-\*\*analytics/index.html](http://sematext.com/search-**analytics/index.html)[http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
> > > Performance Monitoring - [http://sematext.com/spm/index.\*\*html](http://sematext.com/spm/index.**html)[http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)
> > > 
> > > On Friday, September 21, 2012 5:32:37 PM UTC-4, banderon1 wrote:
> > > 
> > > > I have two text fields that are indexed (name and description), and  
> > > > when a query is executed, I want to be able to search for certain keywords  
> > > > based on the query. For example, if I search for "kleenex", I also want it  
> > > > to search for "facial tissue". I have hundreds/thousands of keywords to  
> > > > map, what is the right way to do this?
> > > 
> > > --
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![banderon1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/banderon1/32/2689_2.png) [@banderon1](https://discuss.elastic.co/u/banderon1)\
**Post date:** [September 26, 2012, 5:11pm UTC](https://discuss.elastic.co/t/keyword-map/9102/6 "2012-09-26T17:11:18Z")

</div>

Thanks Otis for introducing me to the skywalker plugin, this is very  
helpful. However, I am not seeing the synonyms in my index. Here is the  
curl request I am using to create my index:

curl -XPUT '[http://localhost:9200/netplenish/](http://localhost:9200/netplenish/)' -d '{

"settings" : {

```
"index" : {

  "analysis" : {

    "analyzer" : {

      "synonym" : {

        "tokenizer" : "whitespace",

        "filter" : ["synonym"]

      }

    },

    "filter" : {

      "synonym" : {

        "type" : "synonym",

        "synonyms" : ["embroidery, embriodery"]

      }

    }

  }

}

```

}

}'

And here is the output I get from skywalker (curl -XGET  
'localhost:9200/netplenish/\_skywalker')

[http://pastebin.com/DGBBue2i](http://pastebin.com/DGBBue2i)

Is there anything blatantly wrong here? Any input is much appreciated!

--

---

<div class="post-metadata">

**Author:** ![banderon1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/banderon1/32/2689_2.png) [@banderon1](https://discuss.elastic.co/u/banderon1)\
**Post date:** [September 27, 2012, 8:04pm UTC](https://discuss.elastic.co/t/keyword-map/9102/7 "2012-09-27T20:04:59Z")

</div>

I figured it out! The problem was that my analyzer was not being mapped to  
my index. Once I added that, the synonyms are working 🙂

On Wed, Sep 26, 2012 at 10:11 AM, banderon1 [banderon1@gmail.com](mailto:banderon1@gmail.com) wrote:

> Thanks Otis for introducing me to the skywalker plugin, this is very  
> helpful. However, I am not seeing the synonyms in my index. Here is the  
> curl request I am using to create my index:
> 
> curl -XPUT '[http://localhost:9200/netplenish/](http://localhost:9200/netplenish/)' -d '{
> 
> "settings" : {
> 
> ```
> "index" : {
> 
> "analysis" : {
> 
> "analyzer" : {
> 
> "synonym" : {
> 
> "tokenizer" : "whitespace",
> 
> "filter" : ["synonym"]
> 
> }
> 
> },
> 
> "filter" : {
> 
> "synonym" : {
> 
> "type" : "synonym",
> 
> "synonyms" : ["embroidery, embriodery"]
> 
> }
> 
> }
> 
> }
> 
> }
> 
> ```
> 
> }
> 
> }'
> 
> And here is the output I get from skywalker (curl -XGET  
> 'localhost:9200/netplenish/\_skywalker')
> 
> [http://pastebin.com/DGBBue2i](http://pastebin.com/DGBBue2i)
> 
> Is there anything blatantly wrong here? Any input is much appreciated!
> 
> --

--

---

<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:11am UTC](https://discuss.elastic.co/t/keyword-map/9102/8 "2017-07-06T03:11:06Z")

</div>


