# Getting docID (ScoreDoc.doc of lucene) in SearchHit

**URL:** <https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015>\
**Category:** Elasticsearch\
**Created:** [October 18, 2013, 11:52am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015 "2013-10-18T11:52:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [October 18, 2013, 11:52am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/1 "2013-10-18T11:52:58Z")

</div>

I need to get the result for reader.getTermVector(docId, "field"). How can  
I get the document number which is ScoreDoc.doc in Lucene search result?  
Is it possible to get that value from SearchHit in ElasticSearch

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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 18, 2013, 8:51pm UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/2 "2013-10-18T20:51:15Z")

</div>

Not quite simple, but you can find the doc id in the query explanation if  
you dig deep enough.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Fri, Oct 18, 2013 at 4:52 AM, Chetana [ambha.career@gmail.com](mailto:ambha.career@gmail.com) wrote:

> I need to get the result for reader.getTermVector(docId, "field"). How  
> can I get the document number which is ScoreDoc.doc in Lucene search result?  
> Is it possible to get that value from SearchHit in Elasticsearch
> 
> 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).

--  
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:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [October 29, 2013, 11:11am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/3 "2013-10-29T11:11:54Z")

</div>

I tried to analyze the explanation but could not figure out which one to  
consider as document id as I am getting multiple SearchHits having same  
doc=0. Please tell me which line to consider for getting the document id?

Here is the sample explanation from ES 0.90.2

Sum of:

max of:0.00385398 = max of:

0.00385398 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.02631579 = coord(1/38)

0.00385398 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.02631579 = coord(1/38)

On Saturday, October 19, 2013 2:21:15 AM UTC+5:30, Ivan Brusic wrote:

> Not quite simple, but you can find the doc id in the query explanation if  
> you dig deep enough.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html)
> 
> Cheers,
> 
> Ivan
> 
> On Fri, Oct 18, 2013 at 4:52 AM, Chetana \<[ambha....@gmail.com](mailto:ambha....@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I need to get the result for reader.getTermVector(docId, "field"). How  
> > can I get the document number which is ScoreDoc.doc in Lucene search result?  
> > Is it possible to get that value from SearchHit in Elasticsearch
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 29, 2013, 10:23pm UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/4 "2013-10-29T22:23:20Z")

</div>

Each search hit should have its own explanation with a different doc id.  
Note that the doc id will be the Lucene id and not the id provided as the  
uid to elasticsearch.

Ivan

On Tue, Oct 29, 2013 at 4:11 AM, Chetana [ambha.career@gmail.com](mailto:ambha.career@gmail.com) wrote:

> I tried to analyze the explanation but could not figure out which one to  
> consider as document id as I am getting multiple SearchHits having same  
> doc=0. Please tell me which line to consider for getting the document id?
> 
> Here is the sample explanation from ES 0.90.2
> 
> Sum of:
> 
> max of:0.00385398 = max of:
> 
> 0.00385398 = product of:
> 
> 0.14645123 = sum of:
> 
> 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> of:
> 
> 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> 
> ), product of:
> 
> 0.079278626 = queryWeight, product of:
> 
> 1.8472979 = idf(docFreq=5, maxDocs=14)
> 
> 0.042915992 = queryNorm
> 
> 1.8472979 = fieldWeight in 0, product of:
> 
> 1.0 = tf(freq=1.0), with freq of:
> 
> 1.0 = termFreq=1.0
> 
> 1.8472979 = idf(docFreq=5, maxDocs=14)
> 
> 1.0 = fieldNorm(doc=0)
> 
> 0.02631579 = coord(1/38)
> 
> 0.00385398 = product of:
> 
> 0.14645123 = sum of:
> 
> 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> of:
> 
> 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> 
> ), product of:
> 
> 0.079278626 = queryWeight, product of:
> 
> 1.8472979 = idf(docFreq=5, maxDocs=14)
> 
> 0.042915992 = queryNorm
> 
> 1.8472979 = fieldWeight in 0, product of:
> 
> 1.0 = tf(freq=1.0), with freq of:
> 
> 1.0 = termFreq=1.0
> 
> 1.8472979 = idf(docFreq=5, maxDocs=14)
> 
> 1.0 = fieldNorm(doc=0)
> 
> 0.02631579 = coord(1/38)
> 
> On Saturday, October 19, 2013 2:21:15 AM UTC+5:30, Ivan Brusic wrote:
> 
> > Not quite simple, but you can find the doc id in the query explanation if  
> > you dig deep enough.
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/en/elasticsearch/)\*\*  
> > reference/current/search-\*\*request-explain.html[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html)
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Fri, Oct 18, 2013 at 4:52 AM, Chetana [ambha....@gmail.com](mailto:ambha....@gmail.com) wrote:
> > 
> > > I need to get the result for reader.getTermVector(docId, "field"). How  
> > > can I get the document number which is ScoreDoc.doc in Lucene search result?  
> > > Is it possible to get that value from SearchHit in Elasticsearch
> > > 
> > > 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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > 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).

--  
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:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [October 30, 2013, 4:48am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/5 "2013-10-30T04:48:19Z")

</div>

Is the attribute look for doc=? which gives the lucene doc id. If so, I am  
not getting the different value for each searcg hit. I got doc=0 for two  
results given below

* * *

sum of:

max of:0.009801095 = max of:

0.009801095 = product of:

0.18622081 = sum of:

0.093110405 = weight(hmn.asset.properties.activitypurpose.purpose:keys in  
0) [PerFieldSimilarity], result of:

0.093110405 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.73647755 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.25 = fieldNorm(doc=0)

0.093110405 = weight(hmn.asset.properties.activitypurpose.purpose:keys in  
0) [PerFieldSimilarity], result of:

0.093110405 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.73647755 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.25 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.003644393 = product of:

0.06924347 = sum of:

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.0049005477 = product of:

0.093110405 = sum of:

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.succescriteria:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.succescriteria:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.003644393 = product of:

0.06924347 = sum of:

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.009801095 = product of:

0.18622081 = sum of:

0.093110405 = weight(hmn.asset.properties.activitypurpose.purpose:keys in  
0) [PerFieldSimilarity], result of:

0.093110405 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.73647755 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.25 = fieldNorm(doc=0)

0.093110405 = weight(hmn.asset.properties.activitypurpose.purpose:keys in  
0) [PerFieldSimilarity], result of:

0.093110405 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.73647755 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.25 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.0049005477 = product of:

0.093110405 = sum of:

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.succescriteria:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.succescriteria:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.0049005477 = product of:

0.093110405 = sum of:

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.objectives:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.objectives:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.0049005477 = product of:

0.093110405 = sum of:

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.objectives:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.046555202 =  
weight(hmn.asset.properties.activitypurpose.perspectives.successcriterias.objectives:keys  
in 0) [PerFieldSimilarity], result of:

0.046555202 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.12642667 = queryWeight, product of:

2.9459102 = idf(docFreq=1, maxDocs=14)

0.042915992 = queryNorm

0.36823878 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.9459102 = idf(docFreq=1, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

max of:0.07322562 = max of:

0.07322562 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.5 = coord(1/2)

0.07322562 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.5 = coord(1/2)

max of:0.14645123 = max of:

0.14645123 = weight(assettype:processasset in 0) [PerFieldSimilarity],  
result of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

------Record No end : 0

------Record No start : 1

sum of:

max of:0.003644393 = max of:

0.003644393 = product of:

0.06924347 = sum of:

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

0.003644393 = product of:

0.06924347 = sum of:

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.034621734 = weight(hmn.asset.description:keys in 0) [PerFieldSimilarity],  
result of:

0.034621734 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.109025724 = queryWeight, product of:

2.540445 = idf(docFreq=2, maxDocs=14)

0.042915992 = queryNorm

0.31755564 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

2.540445 = idf(docFreq=2, maxDocs=14)

0.125 = fieldNorm(doc=0)

0.05263158 = coord(2/38)

max of:0.07322562 = max of:

0.07322562 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.5 = coord(1/2)

0.07322562 = product of:

0.14645123 = sum of:

0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

0.5 = coord(1/2)

max of:0.14645123 = max of:

0.14645123 = weight(assettype:processasset in 0) [PerFieldSimilarity],  
result of:

0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0

), product of:

0.079278626 = queryWeight, product of:

1.8472979 = idf(docFreq=5, maxDocs=14)

0.042915992 = queryNorm

1.8472979 = fieldWeight in 0, product of:

1.0 = tf(freq=1.0), with freq of:

1.0 = termFreq=1.0

1.8472979 = idf(docFreq=5, maxDocs=14)

1.0 = fieldNorm(doc=0)

* * *

On Wednesday, October 30, 2013 3:53:20 AM UTC+5:30, Ivan Brusic wrote:

> Each search hit should have its own explanation with a different doc id.  
> Note that the doc id will be the Lucene id and not the id provided as the  
> uid to elasticsearch.
> 
> Ivan
> 
> On Tue, Oct 29, 2013 at 4:11 AM, Chetana \<[ambha....@gmail.com](mailto:ambha....@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I tried to analyze the explanation but could not figure out which one to  
> > consider as document id as I am getting multiple SearchHits having same  
> > doc=0. Please tell me which line to consider for getting the document id?
> > 
> > Here is the sample explanation from ES 0.90.2
> > 
> > Sum of:
> > 
> > max of:0.00385398 = max of:
> > 
> > 0.00385398 = product of:
> > 
> > 0.14645123 = sum of:
> > 
> > 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> > of:
> > 
> > 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> > 
> > ), product of:
> > 
> > 0.079278626 = queryWeight, product of:
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 0.042915992 = queryNorm
> > 
> > 1.8472979 = fieldWeight in 0, product of:
> > 
> > 1.0 = tf(freq=1.0), with freq of:
> > 
> > 1.0 = termFreq=1.0
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 1.0 = fieldNorm(doc=0)
> > 
> > 0.02631579 = coord(1/38)
> > 
> > 0.00385398 = product of:
> > 
> > 0.14645123 = sum of:
> > 
> > 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> > of:
> > 
> > 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> > 
> > ), product of:
> > 
> > 0.079278626 = queryWeight, product of:
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 0.042915992 = queryNorm
> > 
> > 1.8472979 = fieldWeight in 0, product of:
> > 
> > 1.0 = tf(freq=1.0), with freq of:
> > 
> > 1.0 = termFreq=1.0
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 1.0 = fieldNorm(doc=0)
> > 
> > 0.02631579 = coord(1/38)
> > 
> > On Saturday, October 19, 2013 2:21:15 AM UTC+5:30, Ivan Brusic wrote:
> > 
> > > Not quite simple, but you can find the doc id in the query explanation  
> > > if you dig deep enough.
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/en/elasticsearch/)\*\*  
> > > reference/current/search-\*\*request-explain.html[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html)
> > > 
> > > Cheers,
> > > 
> > > Ivan
> > > 
> > > On Fri, Oct 18, 2013 at 4:52 AM, Chetana [ambha....@gmail.com](mailto:ambha....@gmail.com) wrote:
> > > 
> > > > I need to get the result for reader.getTermVector(docId, "field"). How  
> > > > can I get the document number which is ScoreDoc.doc in Lucene search result?  
> > > > Is it possible to get that value from SearchHit in Elasticsearch
> > > > 
> > > > 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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > .
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [October 31, 2013, 11:37am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/6 "2013-10-31T11:37:32Z")

</div>

Coule you please tell me what key to look for as I am not getting  
a different value for doc=

Thanks

On Wednesday, October 30, 2013 3:53:20 AM UTC+5:30, Ivan Brusic wrote:

> Each search hit should have its own explanation with a different doc id.  
> Note that the doc id will be the Lucene id and not the id provided as the  
> uid to elasticsearch.
> 
> Ivan
> 
> On Tue, Oct 29, 2013 at 4:11 AM, Chetana \<[ambha....@gmail.com](mailto:ambha....@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I tried to analyze the explanation but could not figure out which one to  
> > consider as document id as I am getting multiple SearchHits having same  
> > doc=0. Please tell me which line to consider for getting the document id?
> > 
> > Here is the sample explanation from ES 0.90.2
> > 
> > Sum of:
> > 
> > max of:0.00385398 = max of:
> > 
> > 0.00385398 = product of:
> > 
> > 0.14645123 = sum of:
> > 
> > 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> > of:
> > 
> > 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> > 
> > ), product of:
> > 
> > 0.079278626 = queryWeight, product of:
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 0.042915992 = queryNorm
> > 
> > 1.8472979 = fieldWeight in 0, product of:
> > 
> > 1.0 = tf(freq=1.0), with freq of:
> > 
> > 1.0 = termFreq=1.0
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 1.0 = fieldNorm(doc=0)
> > 
> > 0.02631579 = coord(1/38)
> > 
> > 0.00385398 = product of:
> > 
> > 0.14645123 = sum of:
> > 
> > 0.14645123 = weight(metadata.account:5 in 0) [PerFieldSimilarity], result  
> > of:
> > 
> > 0.14645123 = score(doc=0,freq=1.0 = termFreq=1.0
> > 
> > ), product of:
> > 
> > 0.079278626 = queryWeight, product of:
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 0.042915992 = queryNorm
> > 
> > 1.8472979 = fieldWeight in 0, product of:
> > 
> > 1.0 = tf(freq=1.0), with freq of:
> > 
> > 1.0 = termFreq=1.0
> > 
> > 1.8472979 = idf(docFreq=5, maxDocs=14)
> > 
> > 1.0 = fieldNorm(doc=0)
> > 
> > 0.02631579 = coord(1/38)
> > 
> > On Saturday, October 19, 2013 2:21:15 AM UTC+5:30, Ivan Brusic wrote:
> > 
> > > Not quite simple, but you can find the doc id in the query explanation  
> > > if you dig deep enough.
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/en/elasticsearch/)\*\*  
> > > reference/current/search-\*\*request-explain.html[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html)
> > > 
> > > Cheers,
> > > 
> > > Ivan
> > > 
> > > On Fri, Oct 18, 2013 at 4:52 AM, Chetana [ambha....@gmail.com](mailto:ambha....@gmail.com) wrote:
> > > 
> > > > I need to get the result for reader.getTermVector(docId, "field"). How  
> > > > can I get the document number which is ScoreDoc.doc in Lucene search result?  
> > > > Is it possible to get that value from SearchHit in Elasticsearch
> > > > 
> > > > 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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > .
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:09am UTC](https://discuss.elastic.co/t/getting-docid-scoredoc-doc-of-lucene-in-searchhit/14015/7 "2017-07-06T02:09:38Z")

</div>


