# Weight be position in string?

**URL:** <https://discuss.elastic.co/t/weight-be-position-in-string/19491>\
**Category:** Elasticsearch\
**Created:** [August 27, 2014, 12:14pm UTC](https://discuss.elastic.co/t/weight-be-position-in-string/19491 "2014-08-27T12:14:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [August 27, 2014, 12:14pm UTC](https://discuss.elastic.co/t/weight-be-position-in-string/19491/1 "2014-08-27T12:14:57Z")

</div>

Is it possible to boost the weight a result if it is closer to the start of  
a string in the index? So that searching for 'bar' would weight 'foo bar  
baz' higher than 'foo baz bar'?

I'm working with ngrams, if that helps.

Thanks  
Lee

--  
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/52bf1a41-b01d-4e3a-a61d-ab364afe2869%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52bf1a41-b01d-4e3a-a61d-ab364afe2869%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:06am UTC](https://discuss.elastic.co/t/weight-be-position-in-string/19491/2 "2017-07-06T01:06:03Z")

</div>

Closed on July 6, 2017, 1:06am UTC


