const crossrefs = [
{ oem: '100500', mn_name: 'champion - moyer diebel' },
{ oem: '561341', mn_name: 'allpoints' },
{ oem: '561341', mn_name: 'partstown' },
{ oem: '100500', mn_name: 'partstown' },
{ oem: '100500', mn_name: 'allpoints' },
{ oem: '113220', mn_name: 'champion - moyer diebel' },
{ oem: '113220', mn_name: 'partstown' },
{ oem: '113220', mn_name: 'allpoints' },
{ oem: 'd2241', mn_name: 'insinger' },
{ oem: 'd2241', mn_name: 'partstown' },
{ oem: 'd2241', mn_name: 'allpoints' },
{ oem: '9647252', mn_name: 'meiko' },
{ oem: '9647252', mn_name: 'partstown' },
{ oem: '9647252', mn_name: 'allpoints' },
];
const { body } = await client.search({
index: 'parts',
body: {
query: {
bool: {
should: [
{
bool: {
must: [
{ term: { oem: '100500' } },
{ match: { mn_name: 'champion - moyer diebel' } },
],
},
},
{
bool: {
must: [
{ term: { oem: '113220' } },
{ match: { mn_name: 'champion - moyer diebel' } },
],
},
},
{
bool: {
must: [
{ term: { oem: '561341' } },
{ match: { mn_name: 'allpoints' } },
],
},
},
{
bool: {
must: [
{ term: { oem: '561341' } },
{ match: { mn_name: 'partstown' } },
],
},
},
{
bool: {
must: [
{ term: { oem: '100500' } },
{ match: { mn_name: 'partstown' } },
],
},
},
{
bool: {
must: [
{ term: { oem: '100500' } },
{ match: { mn_name: 'allpoints' } },
],
},
},
{
bool: {
must: [
{ term: { oem: 'd2241' } },
{ match: { mn_name: 'insinger' } },
],
},
},
],
minimum_should_match: '1%',
},
},
},
});
Находит все, кроме Allpoints, но если удалить любое из других, то начинает находить Allpoints
Буду благодарен за любую помощь в данном вопросе.