10up / elasticpress-autosuggest
该软件包已被废弃且不再维护。未建议替代包。
扩展ElasticPress的搜索输入以显示搜索建议
dev-master
2017-03-15 18:24 UTC
This package is not auto-updated.
Last update: 2019-02-20 19:41:35 UTC
README
警告:此插件公开暴露了您的Elasticsearch。如果不正确安全地使用并配合使用保护内容功能,则私有内容可能会公开泄露。
扩展ElasticPress的搜索输入以显示搜索建议
设置
您需要在nginx配置中添加一个端点,将/es-search
请求转发到您的Elasticsearch主机。以下是一个包含所需位置块的示例服务器块:
server {
listen 80;
server_name example.com;
# Elasticsearch endpoint
location /es-search {
# only allow things to hit the _autosuggest API
# change the `_endpoint` to be whatever you'd like to restrict usage to
location ~* (.*)_suggest$ {
# only allow POST requests
limit_except POST {
deny all;
}
# Perform our request
rewrite ^/es-search(.*) $1 break;
proxy_set_header Host $host;
# Use the URL of the server here
proxy_pass http://192.168.50.4:9200;
}
return 403;
}
root /srv/www/example.com;
include /etc/nginx/nginx-wp-common.conf;
}
问题
如果您发现任何错误或对改进插件有任何想法,请提交问题。我们很期待看到社区对这个项目的看法,并欢迎您的反馈!