elasticsearch 6无法安装插件org.wikimedia.search:extra不兼容

时间:2018-04-19 09:13:27

标签: elasticsearch wikimedia

我在docker上安装了弹性搜索版本6.2.3。

尝试安装以下elasticsearch插件时出现以下错误

  

org.wikimedia.search:extra

线程中的异常" main" java.lang.IllegalArgumentException:plugin [extra]与版本[6.2.3]不兼容;是为版本[5.5.2]而设计的

我尝试使用以下命令安装插件:

RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install org.wikimedia.search:extra:5.5.2.3

我试图安装此插件以将wikipedia字典加载到elasticsearch中,但该插件的最新版本是5.5.2

1 个答案:

答案 0 :(得分:2)

两年前,维基媒体已经提供了生产弹性研究指数的转储。因此,将维基百科(也称为维基百科)加载到弹性中现在非常简单

每周都会导出索引,每个维基都有两个导出。

The content index, which contains only article pages, called content;
The general index, containing all pages. This includes talk pages, templates, etc, called general;

你可以在http://dumps.wikimedia.org/other/cirrussearch/current/

找到它们
  • 根据您的需要创建映射。例如:

    {
         "mappings": {
         "page": {
            "properties": {
               "auxiliary_text": {
                  "type": "text"
               },
               "category": {
                  "type": "text"
               },
               "coordinates": {
                  "properties": {
                     "coord": {
                        "properties": {
                           "lat": {
                              "type": "double"
                           },
                           "lon": {
                              "type": "double"
                           }
                        }
                     },
                     "country": {
                        "type": "text"
                     },
                     "dim": {
                        "type": "long"
                     },
                     "globe": {
                        "type": "text"
                     },
                     "name": {
                        "type": "text"
                     },
                     "primary": {
                        "type": "boolean"
                     },
                     "region": {
                        "type": "text"
                     },
                     "type": {
                        "type": "text"
                     }
                  }
               },
               "defaultsort": {
                  "type": "boolean"
               },
               "external_link": {
                  "type": "text"
               },
               "heading": {
                  "type": "text"
               },
               "incoming_links": {
                  "type": "long"
               },
               "language": {
                  "type": "text"
               },
               "namespace": {
                  "type": "long"
               },
               "namespace_text": {
                  "type": "text"
               },
               "opening_text": {
                  "type": "text"
               },
               "outgoing_link": {
                  "type": "text"
               },
               "popularity_score": {
                  "type": "double"
               },
               "redirect": {
                  "properties": {
                     "namespace": {
                        "type": "long"
                     },
                     "title": {
                        "type": "text"
                     }
                  }
               },
               "score": {
                  "type": "double"
               },
               "source_text": {
                  "type": "text"
               },
               "template": {
                  "type": "text"
               },
               "text": {
                  "type": "text"
               },
               "text_bytes": {
                  "type": "long"
               },
               "timestamp": {
                  "type": "date",
                  "format": "strict_date_optional_time||epoch_millis"
               },
               "title": {
                  "type": "text"
               },
               "version": {
                  "type": "long"
               },
               "version_type": {
                  "type": "text"
               },
               "wiki": {
                  "type": "text"
               },
               "wikibase_item": {
                  "type": "text"
               }
            }
         }
      }
    }
    

创建索引后,只需输入:

zcat enwiki-current-cirrussearch-general.json.gz | parallel --pipe -L 2 -N 2000 -j3 'curl -s http://localhost:9200/enwiki/_bulk --data-binary @- > /dev/null'

享受!