Running a Match across Array and treating each row exclusively

Hi,

I had several keys on an object (such as .name1, .name2) and was using dis_max along with match to run independent and identical queries and return the one with the highest score. Now the data has changed to an Array and I can see that Match is working across the items which produces a different score.

Old method (should just one query)

            should.push({
              dis_max: {
                queries: [
                  {
                    match: {
                      nameA: { _name:'nameA', query, ...req.address.params }
                    }
                  }
                ]
              }

So now the requirement is

[
'Andrew Smith Jones',
'Andrew Burke'
]

If I search for 'Smith Jones Burke' the score would be higher, the second row should have no impact as the first row is a higher match.

Thoughts?

what do you mean by second row ? do you mean to order array value when you get response ?

Please add more details like sample document and expected result.

[
'Andrew Smith Jones',
'Andrew Burke'
]

Let's say each word is worth one point and I search 'Smith Jones Burke'

I would like the score to be 2, not 3.

(which is how it was when I used dis_max in conjunction with multiple queries)

bump ^^ :slight_smile:

Bumpty bump, almost like I'm desperate. :wink:

Got to be some means to do this...

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