遵循有关一些基本查询的弹性搜索教程:
#Create the index with no mapping
curl -XPUT 127.0.0.1:9200/startswith/
#add some data
curl -XPOST 127.0.0.1:9200/startswith/test/ -d '{"title":"river dog"}'
curl -XPOST 127.0.0.1:9200/startswith/test/ -d '{"title":"data"}'
curl -XPOST 127.0.0.1:9200/startswith/test/ -d '{"title":"drive"}'
curl -XPOST 127.0.0.1:9200/startswith/test/ -d '{"title":"dzone"}'
#try to perform a "starts-with" style query...
curl -XGET 127.0.0.1:9200/startswith/test/_search?pretty -d '{
"query": {
"match_phrase_prefix": {
"title": {
"query": "d",
"max_expansions": 5
}
}
}
}' | grep title
Run Code Online (Sandbox Code Playgroud)
但我收到了消息no matches found: 127.0.0.1:9200/startswith/test/_search?pretty
。如果我访问http://127.0.0.1:9200/startswith/test/_search
或卷曲它,结果就在那里。我错过了什么?
这是壳的问题。
zsh
用途?
为外卡匹配,所以你必须把它引用到使用一个字符串。
例如;
> echo ?
zsh: no matches found: ?
> echo 127.0.0.1:9200/startswith/test/_search?pretty
zsh: no matches found: 127.0.0.1:9200/startswith/test/_search?pretty
Run Code Online (Sandbox Code Playgroud)
要修复它zsh
,请引用字符串;
> echo "127.0.0.1:9200/startswith/test/_search?pretty"
127.0.0.1:9200/startswith/test/_search?pretty
Run Code Online (Sandbox Code Playgroud)
...或用反斜杠转义问号;
> echo 127.0.0.1:9200/startswith/test/_search\?pretty
127.0.0.1:9200/startswith/test/_search?pretty
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1915 次 |
最近记录: |