# Rate document by term offset or location

**URL:** <https://discuss.elastic.co/t/rate-document-by-term-offset-or-location/320364>\
**Category:** Elasticsearch\
**Created:** [December 2, 2022, 11:45am UTC](https://discuss.elastic.co/t/rate-document-by-term-offset-or-location/320364 "2022-12-02T11:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ostr1969](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ostr1969/32/70103_2.png) [@Ostr1969](https://discuss.elastic.co/u/Ostr1969)\
**Post date:** [December 2, 2022, 11:45am UTC](https://discuss.elastic.co/t/rate-document-by-term-offset-or-location/320364/1 "2022-12-02T11:45:32Z")

</div>

I know that text search can show the location or offset of a term found.  
can I build a function that can rate or boost the doc by the offset location?  
for example if searching fox:  
"brown fox jumping over yellow fence"  
will be rated more than:  
"over yellow fence, a brown fox jumping"

---

<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:** [December 30, 2022, 11:46am UTC](https://discuss.elastic.co/t/rate-document-by-term-offset-or-location/320364/2 "2022-12-30T11:46:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
