首页 > 解决方案 > elasticsearch 7xx exceptions.RequestError

问题描述

请帮我解决elasticsearch的问题。安装此软件包https://github.com/nyaadevs/nyaa后,使用 elasticsearch 的搜索不起作用。config.yml 是为旧版本的 elasticsearch < 6 创建的。现在的弹性版本是最新的(7xx)。

在此处输入图像描述

配置.yml

settings:
  analysis:
    analyzer:
      my_search_analyzer:
        type: custom
        tokenizer: standard
        char_filter:
          - my_char_filter
        filter:
          - lowercase
      my_index_analyzer:
        type: custom
        tokenizer: standard
        char_filter:
          - my_char_filter
        filter:
          - resolution
          - lowercase
          - word_delimit
          - my_ngram
          - trim_zero
          - unique
      # For exact matching - separate each character for substring matching + lowercase
      exact_analyzer:
        tokenizer: exact_tokenizer
        filter:
          - lowercase
      # For matching full words longer than the ngram limit (15 chars)
      my_fullword_index_analyzer:
        type: custom
        tokenizer: standard
        char_filter:
          - my_char_filter
        filter:
          - lowercase
          - word_delimit
          # Skip tokens shorter than N characters,
          # since they're already indexed in the main field
          - fullword_min
          - unique

    tokenizer:
      # Splits input into characters, for exact substring matching
      exact_tokenizer:
        type: pattern
        pattern: "(.)"
        group: 1

    filter:
      my_ngram:
        type: edgeNGram
        min_gram: 1
        max_gram: 15
      fullword_min:
        type: length
        # Remember to change this if you change the max_gram below!
        min: 16
      resolution:
        type: pattern_capture
        patterns: ["(\\d+)[xX](\\d+)"]
      trim_zero:
        type: pattern_capture
        patterns: ["0*([0-9]*)"]
      word_delimit:
        type: word_delimiter
        preserve_original: true
        split_on_numerics: false
    char_filter:
      my_char_filter:
        type: mapping
        mappings: ["-=>_", "!=>_", "_=>\\u0020"]
  index:
    id_field: integer
    sort.order: desc
    # we're running a single es node, so no sharding necessary,
    # plus replicas don't really help either.
    number_of_shards: 1
    number_of_replicas : 0
    # since we disabled the _all field, default query the
    # name of the torrent.
    query:
      default_field: display_name
mappings:
  properties:
    title:
      type: text
      boost: 2
    content:
      type: text
    id:
      type: integer

看起来您的帖子主要是代码;请添加更多详细信息。看起来您的帖子主要是代码;请添加更多详细信息。看起来您的帖子主要是代码;请添加更多细节。

标签: elasticsearch

解决方案


不熟悉 w/nyaa,但id_field: integer看起来很可疑。

不应该id_field: id吗?


推荐阅读