2017-08-30 10 views
0

elasticsearchでクエリをパーコレートしようとしていますが、docsで説明されているようにインデックスを作成しています。エラーが表示されます。私は次のことを実行しました。パーコレートクエリのインデックスを作成する

PUT /my_percolate_index 
{ 
    "mappings": { 
    "doctype": { 
     "properties": { 
      "message": { 
       "type": "text" 
      } 
     } 
    }, 
    "queries": { 
     "properties": { 
      "query": { 
       "type": "percolator" 
      } 
     } 
    } 
    } 
} 

私は次のエラーで迎えています:

{ 
    "error": { 
    "root_cause": [ 
    { 
     "type": "illegal_argument_exception", 
     "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]" 
    } 
    ], 
    "type": "illegal_argument_exception", 
    "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]" 
    }, 
    "status": 400 
} 

は、私はここで何かが足りないのですか?

+0

使用しているESのバージョンは何ですか? – Val

+0

'ES 6.0.0-alpha1'と' NEST 6.0.0-alpha1' –

答えて

0

Since you're using ES 6は、あなたは自分のマッピングタイプの内側ES 6のように、単一のマッピングタイプは、任意のインデックス内で許可されていることを

PUT /my_percolate_index 
{ 
    "mappings": { 
     "doctype": { 
      "properties": { 
       "message": { 
        "type": "text" 
       }, 
       "query": { 
        "type": "percolator" 
       } 
      } 
     } 
    } 
} 

注意をqueryフィールドを移動する必要があります。

+0

私の場合、私は[here](https://stackoverflow.com/a/)のように 'doctype'と' queries'を別の型として持っています40688396/852243)を異なるインデックスに索引付けする必要があります。 –

+0

次に、メッセージデータとクエリの2つの異なるインデックスを作成する必要があります。 – Val

+0

私はそれを試みましたが、私はクエリのプロパティのインデックスに成功しているようには思われません –

関連する問題