ElasticPress icon indicating copy to clipboard operation
ElasticPress copied to clipboard

Add instructions for autosuggest

Open tott opened this issue 5 years ago • 3 comments

When enabling autosuggest an endpoint url needs to be configured but there are no instructions given on how to determine these settings.

Describe the solution you'd like It would be good to try to determine and suggest a reasonable default or provide documentation on how to determine this url.

Designs https://i.imgur.com/06t6UlY.png

tott avatar Sep 26 '19 12:09 tott

Just some short notes on how I managed to set up autosuggest on EP 3.3:

Endpoint URL: /ep-autosuggest

Nginx Config:

location /ep-autosuggest {
  # only allow POST requests
  limit_except POST {
    deny all;
  }

  # Perform our request
  rewrite ^/ep-autosuggest(.*) $1/_search break;
  proxy_set_header Host $host;

  # Use the URL of the server here
  proxy_pass http://localhost:9200;
  return 403;
}

The Nginx config is a slightly modified version of the one from: https://github.com/10up/elasticpress-autosuggest

fabianmarz avatar Jan 08 '20 17:01 fabianmarz

Just some short notes on how I managed to set up autosuggest on EP 3.3:

Endpoint URL: /ep-autosuggest

Nginx Config:

location /ep-autosuggest {
  # only allow POST requests
  limit_except POST {
    deny all;
  }

  # Perform our request
  rewrite ^/ep-autosuggest(.*) $1/_search break;
  proxy_set_header Host $host;

  # Use the URL of the server here
  proxy_pass http://localhost:9200;
  return 403;
}

The Nginx config is a slightly modified version of the one from: https://github.com/10up/elasticpress-autosuggest

@fabianmarz I tried your snippet, but this one only returns 403 with body "User is not authorized to perform this action".

My ES is hosted on AWS with open security policies.

Any suggestion ?

ocountry avatar Sep 07 '20 05:09 ocountry

@ocountry, unfortunately I'm not familiar with AWS and thus cannot point out how to fix it. Is ES AWS running on nginx solely or is it used as proxy with apache? Are you sure the policies are configured correctly? Seems the error message is caused by this.

fabianmarz avatar Sep 07 '20 09:09 fabianmarz