# Tokenizer for html tags attributes

**URL:** <https://discuss.elastic.co/t/tokenizer-for-html-tags-attributes/19850>\
**Category:** Elasticsearch\
**Created:** [September 17, 2014, 6:56pm UTC](https://discuss.elastic.co/t/tokenizer-for-html-tags-attributes/19850 "2014-09-17T18:56:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_5](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Jack\_5](https://discuss.elastic.co/u/Jack_5)\
**Post date:** [September 17, 2014, 6:56pm UTC](https://discuss.elastic.co/t/tokenizer-for-html-tags-attributes/19850/1 "2014-09-17T18:56:48Z")

</div>

Hi.

What i need to achieve is a better html documents indexing.

I started with first analyzer that strips html chars and works with text  
only, but almost half om my searches will be through html tags (and more -  
some specific html attributes). For example, i have an index with content  
field that stores html page content and search might look like _name="generator"  
http-equiv="Wordpress 3.1"_ or it might look like

So i wonder if there is a way to create a tokenizer that would use only  
html tags and split them in pieces (space is ok), so that we get something  
like 'html', 'name="generator"', 'src="jquery.js"'. All i ws able to  
achieve so far is tokenizing each tag as single token (with all params in  
it). Obviously this won't work...

Will be glad to hear any suggestions.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/635d2b97-8dd5-4266-b60e-40300d986828%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/635d2b97-8dd5-4266-b60e-40300d986828%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:01am UTC](https://discuss.elastic.co/t/tokenizer-for-html-tags-attributes/19850/2 "2017-07-06T01:01:29Z")

</div>


