简体   繁体   English

更新 Elasticsearch 中现有索引的映射

[英]Update Mapping of existing Index in Elasticsearch

I am totally new to elastic search.我对弹性搜索完全陌生。 So please forgive me if this is a stupid Question and my Questions might have been answered somewhere else already but I couldn't find it.因此,如果这是一个愚蠢的问题,并且我的问题可能已经在其他地方得到了回答,但我找不到,请原谅我。 I want to use Elastic Search as a search engine for PDF'S and docx's in my network.我想在我的网络中使用 Elastic Search 作为 PDF 和 docx 的搜索引擎。 I used fscrawler to ingest the PDF's to elastic search.我使用 fscrawler 将 PDF 摄取到弹性搜索。 Since the documents I want to ingest are in several languages I wanted to use n-graming for stemming.由于我想摄取的文档有多种语言,我想使用 n-graming 进行词干提取。 To do so I wanted to update my mapping like this为此,我想像这样更新我的映射

PUT test/_mappings/_all
{
"mappings": {
    "title": {
      "properties": {
        "title": {
          "type": "text",
          "fields": {
            "de": {
              "type":     "string",
              "analyzer": "german"
            },
            "en": {
              "type":     "string",
              "analyzer": "english"
            },
             "general": { 
              "type":     "string",
              "analyzer": "trigrams"
          }
        }
      }
    }
  }
}
}

And now I get this Errormessage现在我收到此错误消息

{ "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [mappings : {title={properties={title={type=text, fields={de={type=string, analyzer=german}, en={type=string, analyzer=english}, general={type=string, analyzer=trigrams}}}}}}]" } ], "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [mappings : {title={properties={title={type=text, fields={de={type=string, analyzer=german}, en={type=string, analyzer=english}, general={type=string, analyzer=trigrams}}}}}}]" { "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "根映射定义有不受支持的参数:[mappings : {title={properties={title={type=text, fields ={de={type=string,analyzer=german}, en={type=string,analyzer=english},general={type=string,analyzer=trigrams}}}}}}]" } ], "type" :“mapper_parsing_exception”,“原因”:“根映射定义具有不受支持的参数:[映射:{title={properties={title={type=text, fields={de={type=string,analyzer=german},en ={type=string,analyzer=english},general={type=string,analyzer=trigrams}}}}}}]"
}, "status": 400 } }, "状态": 400 }

Do you have any idea how i can fix this?你知道我该如何解决这个问题吗? Or do you have an idea how I can ingest the files with the right mapping without using fscrawler?或者您知道如何在不使用 fscrawler 的情况下使用正确的映射摄取文件吗?

those are my settings这些是我的设置

    {
  "test": {
    "settings": {
      "index": {
        "mapping": {
          "total_fields": {
            "limit": "2000"
          }
        },
        "number_of_shards": "5",
        "provided_name": "test",
        "creation_date": "1542031632596",
        "analysis": {
          "filter": {
            "trigrams_filter": {
              "type": "ngram",
              "min_gram": "3",
              "max_gram": "3"
            }
          },
          "analyzer": {
            "fscrawler_path": {
              "tokenizer": "fscrawler_path"
            },
            "trigrams": {
              "filter": [
                "lowercase",
                "trigrams_filter"
              ],
              "type": "custom",
              "tokenizer": "standard"
            }
          },
          "tokenizer": {
            "fscrawler_path": {
              "type": "path_hierarchy"
            }
          }
        },
        "number_of_replicas": "1",
        "uuid": "7L3QE5_xRACECVbTFlFY-Q",
        "version": {
          "created": "6040399"
        }
      }
    }
  }
}

My mapping我的映射

{
      "test": {
        "mappings": {
          "_doc": {
            "dynamic_templates": [
              {
                "raw_as_text": {
                  "path_match": "meta.raw.*",
                  "mapping": {
                    "fields": {
                      "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                      }
                    },
                    "type": "text"
                  }
                }
              }
            ],
            "properties": {
              "attachment": {
                "type": "binary"
              },
              "attributes": {
                "properties": {
                  "group": {
                    "type": "keyword"
                  },
                  "owner": {
                    "type": "keyword"
                  }
                }
              },
              "content": {
                "type": "text"
              },
              "file": {
                "properties": {
                  "checksum": {
                    "type": "keyword"
                  },
                  "content_type": {
                    "type": "keyword"
                  },
                  "created": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "extension": {
                    "type": "keyword"
                  },
                  "filename": {
                    "type": "keyword",
                    "store": true
                  },
                  "filesize": {
                    "type": "long"
                  },
                  "indexed_chars": {
                    "type": "long"
                  },
                  "indexing_date": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "last_accessed": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "last_modified": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "url": {
                    "type": "keyword",
                    "index": false
                  }
                }
              },
              "meta": {
                "properties": {
                  "altitude": {
                    "type": "text"
                  },
                  "author": {
                    "type": "text"
                  },
                  "comments": {
                    "type": "text"
                  },
                  "contributor": {
                    "type": "text"
                  },
                  "coverage": {
                    "type": "text"
                  },
                  "created": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "creator_tool": {
                    "type": "keyword"
                  },
                  "date": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "description": {
                    "type": "text"
                  },
                  "format": {
                    "type": "text"
                  },
                  "identifier": {
                    "type": "text"
                  },
                  "keywords": {
                    "type": "text"
                  },
                  "language": {
                    "type": "keyword"
                  },
                  "latitude": {
                    "type": "text"
                  },
                  "longitude": {
                    "type": "text"
                  },
                  "metadata_date": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "modifier": {
                    "type": "text"
                  },
                  "print_date": {
                    "type": "date",
                    "format": "dateOptionalTime"
                  },
                  "publisher": {
                    "type": "text"
                  },
                  "rating": {
                    "type": "byte"
                  },
                  "relation": {
                    "type": "text"
                  },
                  "rights": {
                    "type": "text"
                  },
                  "source": {
                    "type": "text"
                  },
                  "title": {
                    "type": "text"
                  },
                  "type": {
                    "type": "text"
                  }
                }
              },
              "path": {
                "properties": {
                  "real": {
                    "type": "keyword",
                    "fields": {
                      "fulltext": {
                        "type": "text"
                      },
                      "tree": {
                        "type": "text",
                        "analyzer": "fscrawler_path",
                        "fielddata": true
                      }
                    }
                  },
                  "root": {
                    "type": "keyword"
                  },
                  "virtual": {
                    "type": "keyword",
                    "fields": {
                      "fulltext": {
                        "type": "text"
                      },
                      "tree": {
                        "type": "text",
                        "analyzer": "fscrawler_path",
                        "fielddata": true
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更新Elasticsearch中已有字段的映射索引参数 - Update mapping index parameter of existing field in Elasticsearch 是否可以通过Elasticsearch中的映射来更新索引中的现有字段? - Is it possible to update an existing field in an index through mapping in Elasticsearch? 更新现有索引上映射的属性 - Update a property of the mapping on an existing index 在elasticsearch中为具有新类型的现有索引创建映射 - Creating a mapping for an existing index with a new type in elasticsearch 是否可以更新 ElasticSearch 6.x 索引中现有字段映射的“存储”值? - Is it possible to update `store` value of the mapping of an existing field in ElasticSearch 6.x index? 如何使用 python 更新/更改 elasticsearch 中索引映射中的现有字段类型? - How to update/change the existing field type in a mapping of an index in elasticsearch using python? 使用Kibana覆盖/更新现有的Elasticsearch索引映射(geo_point) - Overwrite/Update Existing Elasticsearch Index Mapping (geo_point) using Kibana 无法使用 Elasticsearch 7.x 中的映射更新索引 - Unable to update index with mapping in Elasticsearch 7.x 通过更新索引模板来更新Elasticsearch映射 - Update an Elasticsearch mapping by updating an Index Template 更新要映射到Elasticsearch索引的数据的映射属性 - update mapping property for data going to elasticsearch index
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM