# Similar terms or ontology?

**URL:** <https://discuss.elastic.co/t/similar-terms-or-ontology/3320>\
**Category:** Elasticsearch\
**Created:** [September 10, 2010, 7:08pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320 "2010-09-10T19:08:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Jensen\_2](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@David\_Jensen\_2](https://discuss.elastic.co/u/David_Jensen_2)\
**Post date:** [September 10, 2010, 7:08pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/1 "2010-09-10T19:08:58Z")

</div>

Is there any way in ES that I can specify an ontology of terms that  
should match as being equivalent. For instance a search for "Dave"  
should match "David" and a search for "David" should match "Dave".

David

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [September 10, 2010, 7:24pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/2 "2010-09-10T19:24:31Z")

</div>

I don't think there is any out of the box support, but I believe that  
a custom analyzer could be written to transform tokens to their base  
meaning. Baked in support would be super cool, though.

Best Regards,  
Paul

On Sep 10, 1:08 pm, David Jensen [djense...@gmail.com](mailto:djense...@gmail.com) wrote:

> Is there any way in ES that I can specify an ontology of terms that  
> should match as being equivalent. For instance a search for "Dave"  
> should match "David" and a search for "David" should match "Dave".
> 
> David

---

<div class="post-metadata">

**Author:** ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)\
**Post date:** [September 10, 2010, 7:26pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/3 "2010-09-10T19:26:50Z")

</div>

I would guess that this what you would need is word stemming. Lucene has a  
SnowballAnalyzer (  
[SnowballAnalyzer (Lucene 2.9.4 API)](http://lucene.apache.org/java/2_9_1/api/contrib-snowball/org/apache/lucene/analysis/snowball/SnowballAnalyzer.html))  
for word stemming. So you can probably use that analyzer?

On Fri, Sep 10, 2010 at 8:08 PM, David Jensen [djensen47@gmail.com](mailto:djensen47@gmail.com) wrote:

> Is there any way in ES that I can specify an ontology of terms that  
> should match as being equivalent. For instance a search for "Dave"  
> should match "David" and a search for "David" should match "Dave".
> 
> David

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://www.keteracel.com/paul](http://www.keteracel.com/paul)

---

<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:** [September 10, 2010, 8:00pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/4 "2010-09-10T20:00:16Z")

</div>

The [http://www.elasticsearch.com/docs/elasticsearch/index\_modules/analysis/docs](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/docs)  
covers the analyzers, tokenizers and token filters you can use. For  
example, you can try the porterstem (  
[http://www.elasticsearch.com/docs/elasticsearch/index\_modules/analysis/tokenfilter/](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/tokenfilter/))  
token filter as part of custom analyzer you build.

On Fri, Sep 10, 2010 at 10:26 PM, Paul Loy [keteracel@gmail.com](mailto:keteracel@gmail.com) wrote:

> I would guess that this what you would need is word stemming. Lucene has a  
> SnowballAnalyzer (  
> [SnowballAnalyzer (Lucene 2.9.4 API)](http://lucene.apache.org/java/2_9_1/api/contrib-snowball/org/apache/lucene/analysis/snowball/SnowballAnalyzer.html))  
> for word stemming. So you can probably use that analyzer?
> 
> On Fri, Sep 10, 2010 at 8:08 PM, David Jensen [djensen47@gmail.com](mailto:djensen47@gmail.com) wrote:
> 
> > Is there any way in ES that I can specify an ontology of terms that  
> > should match as being equivalent. For instance a search for "Dave"  
> > should match "David" and a search for "David" should match "Dave".
> > 
> > David
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [http://www.keteracel.com/paul](http://www.keteracel.com/paul)

---

<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 10, 2010, 9:49pm UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/5 "2010-09-10T21:49:57Z")

</div>

Maybe you simply need synonyms functionality?

## Otis

Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Nutch  
Lucene ecosystem search :: [http://search-lucene.com/](http://search-lucene.com/)

On Sep 10, 3:08 pm, David Jensen [djense...@gmail.com](mailto:djense...@gmail.com) wrote:

> Is there any way in ES that I can specify an ontology of terms that  
> should match as being equivalent. For instance a search for "Dave"  
> should match "David" and a search for "David" should match "Dave".
> 
> David

---

<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, 4:19am UTC](https://discuss.elastic.co/t/similar-terms-or-ontology/3320/6 "2017-07-06T04:19:30Z")

</div>


