# Provision to retrieve matched tokens ( From lucene ) and position directly

**URL:** https://discuss.elastic.co/t/provision-to-retrieve-matched-tokens-from-lucene-and-position-directly/14122
**Category:** Elasticsearch
**Created:** [October 26, 2013, 5:46am UTC](https://discuss.elastic.co/t/provision-to-retrieve-matched-tokens-from-lucene-and-position-directly/14122 "2013-10-26T05:46:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [October 26, 2013, 5:46am UTC](https://discuss.elastic.co/t/provision-to-retrieve-matched-tokens-from-lucene-and-position-directly/14122/1 "2013-10-26T05:46:47Z")

</div>

Hi ,

I would like to know if there is any way to retrieve the matched token from  
the index rather than the \_source feed or any other feed stored.

So if the text is "elephant is a big ANIMAL" and i search for the term  
"animal" , my expected result is ( Assuming i have applied the analyzer  
with lowercase)

{  
"token" : "animal",  
"start\_offset" : 20,  
"end\_offset" : 28,  
"type" : "",  
"position" : 5  
}

Is this possible with Elasticsearch ?

Thanks  
Vineeth

--  
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: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [October 27, 2013, 8:46pm UTC](https://discuss.elastic.co/t/provision-to-retrieve-matched-tokens-from-lucene-and-position-directly/14122/2 "2013-10-27T20:46:57Z")

</div>

Unfortunately, even at the Lucene level, this is something which is not  
doable (yet[1]). The API that looks the closest to what you are looking for  
is the term vectors API[2], which will be available in Elasticsearch 1.0.

[1] [https://issues.apache.org/jira/browse/LUCENE-2878](https://issues.apache.org/jira/browse/LUCENE-2878)  
[2]  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-termvectors.html)

--  
Adrien Grand

--  
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:10am UTC](https://discuss.elastic.co/t/provision-to-retrieve-matched-tokens-from-lucene-and-position-directly/14122/3 "2017-07-06T02:10:23Z")

</div>


