2017-01-01 13 views
0

私はESウェブサイトでデモをしようとします:https://www.elastic.co/guide/en/elasticsearch/reference/current/_testing_analyzers.html - カスタムアナライザの最新の例。この例は機能しません。私は例でも何も変えなかった。私はそれがElasticsearchエラーだと思う。誰か助けてくれますか?以下では、ubuntu端末のElastichsearchを示すコマンドとエラーを示します。 私はこの例をelasticsearch-phpにしようとすると同じエラーが発生します。Elasticsearch v5アナライザデモのサンプルが動作しない

curl -XPUT 'localhost:9200/my_index?pretty' -d' 
> { 
> "settings": { 
>  "analysis": { 
>  "analyzer": { 
>   "std_folded": { 
>   "type": "custom", 
>   "tokenizer": "standard", 
>   "filter": [ 
>    "lowercase", 
>    "asciifolding" 
>   ] 
>   } 
>  } 
>  } 
> }, 
> "mappings": { 
>  "my_type": { 
>  "properties": { 
>   "my_text": { 
>   "type": "text", 
>   "analyzer": "std_folded" 
>   } 
>  } 
>  } 
> } 
> }' 
{ 
    "acknowledged" : true, 
    "shards_acknowledged" : true 
} 

良い、アナライザが作成した:彼の例に示すように、まず

は、私は、アナライザを作成します。しかし、ではない作品例をテスト:

curl -XGET 'localhost:9200/my_index/_analyze ?pretty' -d' 
> { 
> "analyzer": "std_folded", 
> "text":  "Is this déjà vu?" 
> }' 

そしてES私に答える:

{ 
"error": 
    {"root_cause": 
    [{ 
     "type":"index_not_found_exception", 
     "reason":"no such index", 
     "resource.type":"index_or_alias", 
     "resource.id":"bad-request", 
     "index_uuid":"_na_", 
     "index":"bad-request" 
    }], 
    "type":"index_not_found_exception", 
    "reason":"no such index", 
    "resource.type":"index_or_alias", 
    "resource.id":"bad-request", 
    "index_uuid":"_na_", 
    "index":"bad-request"}, 
"status":404 
} 

は私が間違って何をしているのですか?私はすべてのインデックスを削除し、再度作成、私はelasticsearchを再開しようとしました - しかし、役に立たない。 P.P.私の悪い英語のためにすみません。

答えて

1

あなたのGET要求は間違っています。 '_analyze'と '?pretty'の間にスペースを入れてはならないので、カールは

curl -XGET 'localhost:9200/my_index/_analyze?pretty' -d' 

となるはずです。

+0

ありがとう@ ravi-naik!その作業!つまり、デモには構文エラーがあります。これは、「COPY AS CURL」を介してコピーすると、すべてが間違ったスペースでコピーされるためです。 –

+0

正解、私は[問題を提出しました](https://github.com/elastic/docs/issues/139)、解決するかどうか確認しましょう。 – Val

関連する問題