2017 © Pedro Peláez
 

wordpress-plugin elasticpress-autosuggest

Extend ElasticPress's search inputs to display search suggestions

image

10up/elasticpress-autosuggest

Extend ElasticPress's search inputs to display search suggestions

  • Wednesday, March 15, 2017
  • by 10up
  • Repository
  • 39 Watchers
  • 26 Stars
  • 121 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 8 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

ElasticPress Autosuggest

Warning: This plugin exposes your Elasticsearch publically. If not properly secured and used in conjunction with the Protected Content function, private content can be leaked publically., (*1)

Extend ElasticPress's search inputs to display search suggestions, (*2)

Setup

You need to add an endpoint to your nginx config, that forwards requests for /es-search to your Elasticsearch host. Here is an example server block with the required location block:, (*3)

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;
}

Issues

If you identify any errors or have an idea for improving the plugin, please open an issue. We're excited to see what the community thinks of this project, and we would love your input!, (*4)

The Versions

15/03 2017

dev-master

9999999-dev

Extend ElasticPress's search inputs to display search suggestions

  Sources   Download

GPLv2