当我尝试使用ES网站做一个演示时:https://www.elastic.co/guide/en/elasticsearch/reference/current/_testing_analyzers.html -自定义分析器的最新示例。这个例子不起作用。我没有更改任何内容,即使在示例中也是如此。我认为这是Elasticsearch的错误。有人能帮我吗?下面我展示了在ubuntu终端中显示Elastichsearch的命令和错误。当我试图在elasticsearch-php中创建这个示例时,同样的错误也发生了。
首先,我创建分析器,如示例所示:
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 -但是没有用。另外,请原谅我的英语不好。
https://stackoverflow.com/questions/41415571
复制相似问题