How to create multiple context field in elastic search verion 6.2.3 so that i can do and operation with the content

      "suggest": {
        "type": "completion",
        "analyzer": "my_custom_analyzer",
        "preserve_separators": true,
        "preserve_position_increments": true,
        "max_input_length": 50,
        "contexts": [
          {
            "name": "cityName",
            "type": "CATEGORY",
            "path": "cityName"
          },
          {
            "name": "templateTexts",
            "type": "CATEGORY",
            "path": "templateTexts"
          }
        ]
      }

here is my suggest mapping.

i want to have query like

  "suggest": {
  "contextual": {
    "prefix": "my-text",
    "completion": {
      "field": "suggest",
      "size": 10,
      "skip_duplicates": true,
      "contexts": {
        "cityName": [
          {
            "context": "New Delhi And NCR",
            "boost": 1,
            "prefix": false
          }
        ],
        "templateTexts": [
          {
            "context": "abcd",
            "boost": 1,
            "prefix": false
          }
        ]
      }
    }
  }
  }

but when i query it gives me or operation for cityName and template texts.
Can you plz tell me how to achieve and operation ?

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