# Scoring and sort by entering one array into another

**URL:** <https://discuss.elastic.co/t/scoring-and-sort-by-entering-one-array-into-another/169565>\
**Category:** Elasticsearch\
**Created:** [February 22, 2019, 11:19am UTC](https://discuss.elastic.co/t/scoring-and-sort-by-entering-one-array-into-another/169565 "2019-02-22T11:19:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Behemo1h](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/behemo1h/32/130721_2.png) [@Behemo1h](https://discuss.elastic.co/u/Behemo1h)\
**Post date:** [February 22, 2019, 11:19am UTC](https://discuss.elastic.co/t/scoring-and-sort-by-entering-one-array-into-another/169565/1 "2019-02-22T11:19:21Z")

</div>

Hi guys.

1. I have the following task. Example. I have objects  
obj1 [  
'id':123,  
'arrayField':[  
1,  
2,  
3  
]  
],  
obj2 [  
'id':321,  
'arrayField':[  
10,  
25,  
3  
]  
]

So, i have array for search searchArray = [7,9,12,3,2].  
I need all object which contain in "arrayField" any value from "searchArray" , but need sorting and scoring by how many values in "arrayField".

It simple OR in search, and scoring will work perfectly by default, or need something else ?

1. Second question, can i get else in result % how much elements contains ?

Many Thanks !

---

<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:** [March 22, 2019, 11:19am UTC](https://discuss.elastic.co/t/scoring-and-sort-by-entering-one-array-into-another/169565/2 "2019-03-22T11:19:39Z")

</div>

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