Keyword filter requires either `keywords` or `keywords_path` to be configured

Hello to all,
I just implemented elastics on my ecommerce and after creating all the documents, I sent through the settings that I found to this page of the documentation.
https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html#italian-analyzer

when once closed and send the new settings, I go to open when index I from this error.

{
   "error": {
  "root_cause": [
     {
        "type": "illegal_argument_exception",
        "reason": "keyword filter requires either `keywords` or `keywords_path` to be configured"
     }
  ],
  "type": "illegal_argument_exception",
  "reason": "keyword filter requires either `keywords` or `keywords_path` to be configured"
   },
   "status": 400
}

I try to re-send the new setting by removing the filter of keywords, but nothing index does not want to leave.

Someone can help me figure out how I can fix this problem? I would not lose any documents that I addressed ..

Thanks anticipamente.

Maybe try to put an empty string into your list of keywords?

I try put this

PUT /myindex/_settings
{
  "settings": {
    "analysis": {
      "filter": {
        "italian_elision": {
          "type": "elision",
          "articles": [
                "c", "l", "all", "dall", "dell",
                "nell", "sull", "coll", "pell",
                "gl", "agl", "dagl", "degl", "negl",
                "sugl", "un", "m", "t", "s", "v", "d"
          ]
        },
        "italian_stop": {
          "type":       "stop",
          "stopwords":  "_italian_" 
        },
        "italian_stemmer": {
          "type":       "stemmer",
          "language":   "light_italian"
        },
        "italian_keywords": {
                 "type": "keyword_marker",
                 "keywords_path" : ["text","test"]
                }
      },
      "analyzer": {
        "italian": {
          "tokenizer":  "standard",
          "filter": [
            "italian_elision",
            "lowercase",
            "italian_stop",
            "italian_stemmer"
          ]
        }
      }
    }
  }
}

but elastic response with:

keyword filter requires either keywords or keywords_path to be configured

Why I can not change the settings?

I send this for update settings after close index:

{
  "settings": {
    "analysis": {
      "filter": {
        "italian_elision": {
          "type": "elision",
          "articles": [
                "c", "l", "all", "dall", "dell",
                "nell", "sull", "coll", "pell",
                "gl", "agl", "dagl", "degl", "negl",
                "sugl", "un", "m", "t", "s", "v", "d"
          ]
        },
        "italian_stop": {
          "type":       "stop",
          "stopwords":  "_italian_" 
        },
        "italian_keywords": {
          "type":       "keyword_marker",
          "keywords":   ["test","test2"] 
        },
        "italian_stemmer": {
          "type":       "stemmer",
          "language":   "light_italian"
        }
      },
      "analyzer": {
        "italian": {
          "tokenizer":  "standard",
          "filter": [
            "italian_elision",
            "lowercase",
            "italian_stop",
            "italian_keywords",
            "italian_stemmer"
          ]
        }
      }
    }
  }
}

And response this:

{
   "error": {
  "root_cause": [
     {
        "type": "illegal_argument_exception",
        "reason": "keyword filter requires either `keywords` or `keywords_path` to be configured"
     }
  ],
  "type": "illegal_argument_exception",
  "reason": "keyword filter requires either `keywords` or `keywords_path` to be configured"
   },
   "status": 400
}

Can you share the output of GET myindex/_settings?

{
   "fm": {
      "settings": {
         "index": {
            "number_of_shards": "5",
            "provided_name": "fm",
            "creation_date": "1490196785927",
            "analysis": {
               "filter": {
                  "italian_elision": {
                     "type": "elision",
                     "articles": [
                        "c",
                        "l",
                        "all",
                        "dall",
                        "dell",
                        "nell",
                        "sull",
                        "coll",
                        "pell",
                        "gl",
                        "agl",
                        "dagl",
                        "degl",
                        "negl",
                        "sugl",
                        "un",
                        "m",
                        "t",
                        "s",
                        "v",
                        "d"
                     ]
                  },
                  "italian_stemmer": {
                     "type": "stemmer",
                     "language": "light_italian"
                  },
                  "italian_keywords": {
                     "type": "keyword_marker"
                  },
                  "italian_stop": {
                     "type": "stop",
                     "stopwords": "_italian_"
                  }
               },
               "analyzer": {
                  "italian": {
                     "filter": [
                        "italian_elision",
                        "lowercase",
                        "italian_stop",
                        "italian_keywords",
                        "italian_stemmer"
                     ],
                     "tokenizer": "standard"
                  }
               }
            },
            "number_of_replicas": "1",
            "uuid": "6IyROmH4QluP61Z908cB6A",
            "version": {
               "created": "5020299"
            }
         }
      }
   }
}

I can reproduce the issue but can't think of a way to get this index back to work. I opened an issue: https://github.com/elastic/elasticsearch/issues/23787.

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