# Right way to tag based on keywords

**URL:** <https://discuss.elastic.co/t/right-way-to-tag-based-on-keywords/11465>\
**Category:** Elasticsearch\
**Created:** [April 5, 2013, 4:44pm UTC](https://discuss.elastic.co/t/right-way-to-tag-based-on-keywords/11465 "2013-04-05T16:44:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pr2012](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pr2012/32/2186_2.png) [@pr2012](https://discuss.elastic.co/u/pr2012)\
**Post date:** [April 5, 2013, 4:44pm UTC](https://discuss.elastic.co/t/right-way-to-tag-based-on-keywords/11465/1 "2013-04-05T16:44:17Z")

</div>

We are migrating a document classifier from a mysql backend to  
elasticsearch. While the long term plan is to use naive bayes, in the short  
term we want to mimick the existing keyword based process. We have a  
category with a list of keywords associated with it, if a document has one  
of those keywords, we apply the category. So one way to do this in ES would  
be to just search the documents for the keywords, and apply the categories  
where we get a match. However I was wondering if there is a smarter way to  
do this, possibly using percolators.

--  
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:42am UTC](https://discuss.elastic.co/t/right-way-to-tag-based-on-keywords/11465/2 "2017-07-06T02:42:34Z")

</div>


