# Token attributes

**URL:** <https://discuss.elastic.co/t/token-attributes/4055>\
**Category:** Elasticsearch\
**Created:** [March 8, 2011, 1:26am UTC](https://discuss.elastic.co/t/token-attributes/4055 "2011-03-08T01:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabiano\_Nunes](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Fabiano\_Nunes](https://discuss.elastic.co/u/Fabiano_Nunes)\
**Post date:** [March 8, 2011, 1:26am UTC](https://discuss.elastic.co/t/token-attributes/4055/1 "2011-03-08T01:26:22Z")

</div>

Hello,

I'm coming from "pure" lucene and diving into elasticsearch/solr for  
scalability purporses.

Now, I'm trying to store some attributes found in a XML document. More  
specifically, token coordinates for future highlighting.  
Example: I have a XML with this structure:

elastic  
search  
community

I want to store the @c attribute from word element (coordinates  
left,width,top,height) in each token. So, in the search, I'll retrieve  
each  
token position for highlighting. There is any good approach to do  
this?  
In Lucene, I'm using payloads, but I don't know use them in  
elasticsearch.

---

<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:** [March 8, 2011, 6:48am UTC](https://discuss.elastic.co/t/token-attributes/4055/2 "2011-03-08T06:48:01Z")

</div>

This is more complicated to expose in elasticsearch. You will need to build your own analyzer that knows how to parse this and store the relevant data. The problem then is that there isn't a formal hook point to extract it and return it from a search request.  
On Tuesday, March 8, 2011 at 3:26 AM, Fabiano Nunes wrote:

> Hello,
> 
> I'm coming from "pure" lucene and diving into elasticsearch/solr for  
> scalability purporses.
> 
> Now, I'm trying to store some attributes found in a XML document. More  
> specifically, token coordinates for future highlighting.  
> Example: I have a XML with this structure:
> 
> elastic  
> search  
> community
> 
> I want to store the @c attribute from word element (coordinates  
> left,width,top,height) in each token. So, in the search, I'll retrieve  
> each  
> token position for highlighting. There is any good approach to do  
> this?  
> In Lucene, I'm using payloads, but I don't know use them in  
> elasticsearch.

---

<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:10am UTC](https://discuss.elastic.co/t/token-attributes/4055/3 "2017-07-06T04:10:35Z")

</div>

Closed on July 6, 2017, 4:10am UTC


