# Ranking using painless

**URL:** <https://discuss.elastic.co/t/ranking-using-painless/65208>\
**Category:** Elasticsearch\
**Created:** [November 7, 2016, 11:49am UTC](https://discuss.elastic.co/t/ranking-using-painless/65208 "2016-11-07T11:49:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmmum](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@ahmmum](https://discuss.elastic.co/u/ahmmum)\
**Post date:** [November 7, 2016, 11:49am UTC](https://discuss.elastic.co/t/ranking-using-painless/65208/1 "2016-11-07T11:49:24Z")

</div>

Does elasticsearch supports field level ranking factors supported in Sphinx like, min\_hit\_pos, lcs, hit\_count natively?  
If so, can someone point out the page where I can read this up?  
If not, what would be the ways to support that?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 7, 2016, 1:51pm UTC](https://discuss.elastic.co/t/ranking-using-painless/65208/2 "2016-11-07T13:51:22Z")

</div>

Hey,

I do not know what the sphins field level ranking factors do - if you want to do customized scoring, which takes the values of fields into account the [function score query](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-function-score-query.html#query-dsl-function-score-query) might be something to check out.

--Alex

---

<div class="post-metadata">

**Author:** ![ahmmum](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@ahmmum](https://discuss.elastic.co/u/ahmmum)\
**Post date:** [November 7, 2016, 3:06pm UTC](https://discuss.elastic.co/t/ranking-using-painless/65208/3 "2016-11-07T15:06:32Z")

</div>

I am already doing that. However, I need to get longest\_common\_subseqence, term frequency, and prefix match score to add to the custom score.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 7, 2016, 3:27pm UTC](https://discuss.elastic.co/t/ranking-using-painless/65208/4 "2016-11-07T15:27:05Z")

</div>

Hey,

you have some more [advanced text scoring options](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-advanced-scripting.html) available in scripting, but not sure if that is sufficient in what you want to do. If not adding your own custom similarity might be an option.

--Alex

---

<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 5, 2016, 3:27pm UTC](https://discuss.elastic.co/t/ranking-using-painless/65208/5 "2016-12-05T15:27:11Z")

</div>

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