0

Below is my index setting. I'm using shingle filter for xyz type of index for field synonym.

{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer_keyword": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": [
            "asciifolding",
            "lowercase"
          ]
        },
        "my_analyzer_shingle": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "asciifolding",
            "lowercase",
            "shingle"
          ]
        }
      }
    }
  }
},
abc: {
  "abc": {
    "properties": {
      "value": {
        "type": "string",
        "search_analyzer": "my_analyzer_keyword",
        "analyzer": "my_analyzer_keyword"
      }
    }
  }
},
xyz: {
  "xyz": {
    "properties": {
      "synonym": {
        "type": "string",
        "search_analyzer": "my_analyzer_shingle",
        "analyzer": "my_analyzer_keyword"
      }
    }
  }
}

I have input text in which no of words can be 30 or more. My requirement is to get all the synonym field of type xyz from this particular input text which im providing. So im using the following query but it is throwing BooleanQuery$TooManyClauses exception.

{
     "query": {
        "match": {
            "synonym": {
                "query": "abas asas asas qwqw ererer asas asas kjjkkj hhha asas nnn jhhha kkka nnna asas qwqw asas qwqw sdsd qwqw erer rtrtr fgfg asas nnn jhhha kkka nnna asas qwqw asas qwqw sdsd qwqw erer rtrtr fgfg "
            }
        }
    }
}

Also i need to identify all one letter synonym as well as two letter synonym from this input text. I have also tried increasing the indices.query.bool.max_clause_count 4096. BUt still its throwing error.

1 Answers1

1

For the input text given, it is exceeding too many clauses/terms which is more than max clause count 4096 setting provided while creating the index. solution is to break the input text into two or more queries and combining the result of these is working fine. 2 shingle is working fine with 13 letter input text with setting of max clause count as 4096.