I have the following structure of objects in ElasticSearch:
{
_id: 1,
myObj: {
myCol: [{id: 1, name:"1"}, {id: 2, name:"2"}, {id: 3, name:"3"}]
}
},
{
_id: 2,
myObj: {
myCol: [{id: 2, name:"2"}, {id: 3, name:"3"}, {id: 4, name:"4"}]
}
},
I'm using C# NEST library to create queries. I want to search myCol collection of objects, using collection of identifiers.
Example #1: Search request: identifiers [2, 3] Result: Both objects are returned
Example #2: Search request: identifier: [1] Result: First object is returned
Example #3: Search request: identifier: [1, 2, 3, 4] Result: No objects are returned
What i'm actullay trying to do is a query "Contains all".
Please note:
- C# NEST MultiMatchQuery type does not support integer arrays (only strings. So bad). So please don't offer me to use this type of query
- I'm using Object Initializer query syntax
- A correct query in ElasticSearch syntax would be enough.