1

我正在为 CouchDB 使用 River 插件,当我执行以下 curl 命令时:

curl -XPUT 'localhost:9200/_river/blog/_meta' -d '{
  "type": "couchdb",
  "couchdb": {
    "host": "localhost",
    "port": 5984,
    "db": "blog",
    "filter": null
  },
  "index": {
    "analysis": {
      "analyzer": {
        "whitespace": {
          "type": "whitespace",
          "filter": "lowercase"
        },
        "ox_edgeNGram": {
          "type": "custom",
          "tokenizer": "ox_t_edgeNGram",
          "filter": [
            "lowercase"
          ]
        },
        "ox_NGram": {
          "type": "custom",
          "tokenizer": "ox_t_NGram",
          "filter": [
            "lowercase"
          ]
        }
      },
      "tokenizer": {
        "ox_t_edgeNGram": {
          "type": "edgeNGram",
          "min_gram": 2,
          "max_gram": 25,
          "side": "front"
        },
        "ox_t_NGram": {
          "type": "NGram",
          "min_gram": 2,
          "max_gram": 25
        }
      }
    }
  }
}'

收到回复:

{
  "ok": true,
  "_index": "_river",
  "_type": "blog",
  "_id": "_meta",
  "_version": 1
}

我遇到的问题是,当我想在浏览器中查看设置并转到: http://localhost:9200/blog/_settings?pretty=true

返回的 json 如下,但我期待有关我认为我创建的分析器等的信息。

返回的 JSON:

{
  "blog": {
    "settings": {
      "index.number_of_shards": "5",
      "index.number_of_replicas": "1"
    }
  }
}

还应该注意的是,当我不使用 River 创建博客索引并运行 curl 命令输入分析信息时,我确实会收到来自浏览器的响应,指示我输入的设置。

使用 River 插件时如何设置索引的默认设置?

4

2 回答 2

3

要解决此问题:

  1. 创建新的 Elasticsearch 索引 + 映射等。
  2. 创建新的 Elasticsearch River,索引的名称设置为在第一步中创建的索引的名称。

我在这里找到了答案:

http://groups.google.com/a/elasticsearch.com/group/users/browse_thread/thread/5ebf1556d139d5ac/f17e71e04cac5889?lnk=gst&q=couchDB+river+settings#f17e71e04cac5889

于 2011-10-28T20:48:07.213 回答
1

你可以试试这个 urlhttp://localhost:9200/blog/_mapping?pretty=true 在响应映射中,如果没有明确提到分析器,那么它就是默认分析器。

于 2012-02-28T05:40:33.567 回答