1

カスタム index_settings で Elasticsearch jdbc jriver プラグインを使用しようとしていますが、インデックスの作成に失敗しているようです。これが私の文字列です:

    # search channels
PUT /_river/tetours/_meta
{
   "type": "jdbc",
   "jdbc": {
      "driver": "com.mysql.jdbc.Driver",
      "url": "jdbc:mysql://localhost:3306/test",
      "user": "blah",
      "password": "******",
      "sql": "SELECT id AS _id,title,city FROM channel where active=1",
      "strategy": "simple",
      "autocommit": true,
      "index": "teindex",
      "type": "tours",
      "index_settings" : "{ \"analysis\" : { \"analyzer\": { \"tindex_analyzer\": { \"tokenizer\": \"standard\", \"filter\": [\"standard\",\"lowercase\"]},\"tsearch_analyzer\": {\"tokenizer\": \"standard\",\"filter\": [\"standard\",\"synonym\",\"lowercase\"]}}, \"filter\" : { \"synonym\" : { \"type\" : \"synonym\", \"synonyms_path\" : \"analysis/synonym.txt\" }}}}",
      "type_mapping": "{ \"tours\": {\"properties\": {\"title\": {  \"type\": \"string\",\"index\": \"analyzed\", \"index_analyzer\": \"tindex_analyzer\", \"search_analyzer\": \"tsearch_analyzer\", \"store\": \"yes\"}}}}",     
      "poll": "15m"
   }
}

ログファイルで受け取ったエラーメッセージは次のとおりです。

[2014-02-25 05:45:48,183][DEBUG][action.admin.indices.settings] [Miles Warren] failed to update settings on indices [teindex]
org.elasticsearch.ElasticSearchIllegalArgumentException: Can't update non dynamic settings[[index.analysis.analyzer.tindex_analyzer.tokenizer, index.analysis.analyzer.tsearch_analyzer.tokenizer, index.analysis.analyzer.tindex_analyzer.filter.0, index.analysis.analyzer.tsearch_analyzer.filter.0]] for open indices[[teindex]]
        at org.elasticsearch.cluster.metadata.MetaDataUpdateSettingsService$2.execute(MetaDataUpdateSettingsService.java:248)
        at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:300)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:135)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
[2014-02-25 05:45:48,183][WARN ][org.xbib.elasticsearch.river.jdbc.JDBCRiver] [Miles Warren] [jdbc][tetours] failed to create index [teindex], disabling JDBC river...
org.elasticsearch.ElasticSearchIllegalArgumentException: Can't update non dynamic settings[[index.analysis.analyzer.tindex_analyzer.tokenizer, index.analysis.analyzer.tsearch_analyzer.tokenizer, index.analysis.analyzer.tindex_analyzer.filter.0, index.analysis.analyzer.tsearch_analyzer.filter.0]] for open indices[[teindex]]
        at org.elasticsearch.cluster.metadata.MetaDataUpdateSettingsService$2.execute(MetaDataUpdateSettingsService.java:248)
        at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:300)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:135)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

誰が何がうまくいかなかったのか理解できますか?構文は正しいようです。

4

1 に答える 1

0

これらの種類の設定 (フィルター、アナライザーなど) をライブ インデックスに書き込むことはできません。インデックスを閉じて変更し、再度開く必要があります

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html

JDBCRiver のコードを一見しただけでは、簡単に処理する方法が見つかりませんでした。

于 2014-02-25T12:10:19.397 に答える