0

Need help with specific ES query. I have objects at Elastic Search index. Example of one of them (Participant):

{
        "_id": null,
        "ObjectID": 6008,
        "EventID": null,
        "IndexName": "crmws",
        "version_id": 66244,
        "ObjectData":             {
           "PARTICIPANTTYPE": "2",
           "STATE": "ACTIVE",
           "EXTERNALID": "01010111",
           "CREATORID": 1006,
           "partAttributeList":               
           [
              {
                 "SYSNAME": "A",
                 "VALUE": "V1"
              },
              {
                 "SYSNAME": "B",
                 "VALUE": "V2"
              },
              {
                 "SYSNAME": "C",
                 "VALUE": "V2"
              }
           ],
           ....

I need to find the only entity(s) by partAttributeList entities. For example whole Participant entity with SYSNAME=A, VALUE=V1 at the same entity of partAttributeList.

If i use usul matches:

{"match": {"ObjectData.partAttributeList.SYSNAME": "A"}},
{"match": {"ObjectData.partAttributeList.VALUE": "V1"}}

Of course I will find more objects than I really need. Example of redundant object that can be found:

              ...
              {
                 "SYSNAME": "A",
                 "VALUE": "X"
              },
              {
                 "SYSNAME": "B",
                 "VALUE": "V1"
              }..
Ilya P
  • 37
  • 1
  • 6

1 Answers1

0

What I get you are trying to do is to search multiple fields of the same object for exact matches of a piece of text so please try this out: https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-query-strings.html

el Punch
  • 210
  • 2
  • 6