# Taxonomy support in ES

**URL:** <https://discuss.elastic.co/t/taxonomy-support-in-es/11553>\
**Category:** Elasticsearch\
**Created:** [April 11, 2013, 5:54pm UTC](https://discuss.elastic.co/t/taxonomy-support-in-es/11553 "2013-04-11T17:54:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casey\_jordan\_jorsek\_](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@casey\_jordan\_jorsek\_](https://discuss.elastic.co/u/casey_jordan_jorsek_)\
**Post date:** [April 11, 2013, 5:54pm UTC](https://discuss.elastic.co/t/taxonomy-support-in-es/11553/1 "2013-04-11T17:54:34Z")

</div>

Hi all,

First let me say thank you to everyone who has contributed to this project  
to make it what it is.

We are intergrating ES into our native XML database so we can combine  
structured XQuery search with metadata and faceted search.

One thing that we really need to be able to do is add taxonomy support to  
our searches.

Consider the following taxonomic structure:

-"Medical professionals"  
-"Nurse"  
-"Nurse practitioner"  
-"Doctor"  
-"Oncologist"  
-"Pediatrician"  
-"Cardiologist"  
-"Surgon"

We would like to enable ES to use this taxonomy in a few ways:

Keyword expansion - For a given search term, also search on terms which the  
taxonomy defines as child terms. For instance, someone might search for  
'doctor', and the system would also understand to include "oncologist,  
pediatrician, surgon" etc.

Keyword reduction - The reverse of keyword expansion, someone might enter  
oncologist, and the system might include "doctor" (This is a version of  
stemming)

I am also hoping there are other cool things I haven't thought of.

I am wondering if this functionality would be best implemented pre-search,  
in our system, or if ES has capabilities to do this natvely?

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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 12, 2013, 10:18am UTC](https://discuss.elastic.co/t/taxonomy-support-in-es/11553/2 "2013-04-12T10:18:33Z")

</div>

Hi Casey

> Consider the following taxonomic structure:
> 
> -"Medical professionals"  
> -"Nurse"  
> -"Nurse practitioner"  
> -"Doctor"  
> -"Oncologist"  
> -"Pediatrician"  
> -"Cardiologist"  
> -"Surgon"
> 
> We would like to enable ES to use this taxonomy in a few ways:
> 
> Keyword expansion - For a given search term, also search on terms  
> which the taxonomy defines as child terms. For instance, someone might  
> search for 'doctor', and the system would also understand to include  
> "oncologist, pediatrician, surgon" etc.

I'd set the field to be {type: "string", index: "not\_analyzed"} then  
index values as, eg:

["Medical professionals", "Doctor", "Oncologist"]

Then you can filter on { "term": { "tag": "Oncologist" }}  
or { "term: { "tag": "Doctor" }}

clint

--  
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:41am UTC](https://discuss.elastic.co/t/taxonomy-support-in-es/11553/3 "2017-07-06T02:41:23Z")

</div>

Closed on July 6, 2017, 2:41am UTC


