la-haute-societe / craft-elasticsearch

Bring the power of Elasticsearch to your Craft CMS projects
Other
18 stars 14 forks source link

AWS access point credentials #29

Open watchwood opened 2 years ago

watchwood commented 2 years ago

What exactly is the plugin looking for in terms of username and password for connected to an ES instance on AWS? Is it the Access Key / Private Key, or something else?

nstCactus commented 2 years ago

I have never used an Elasticsearch instance on AWS so I can only guess, but I wouldn't be surprised if your instance wasn't available to the outside world.

The plugin allows you to specify the username and password to use as HTTP basic auth credentials for your Elasticsearch's instance REST API.

Hope this helps...

nstCactus commented 2 years ago

This looks like a world of trouble!

Apparently one has to use the access key id and secret key to somehow sign each Elasticsearch request. The AWS documentation provides examples in a few languages but nothing for PHP.

I found this https://aws.plainenglish.io/hiking-on-aws-sign-php-elasticsearch-client-requests-for-amazon-elasticsearch-service-be08c8e9dcd0 that explains how to do it, but the plugin doesn't use that client.

watchwood commented 2 years ago

Ya, it's not ideal. Right now I'm trying to bypass it by setting up a local ES instance on the server.

For a semi-unrelated follow up question, is there a way to force the plugin to ignore/suppress pages that throw errors when forcing it to reindex the whole site?

watchwood commented 2 years ago

Another follow up question, is there a way to have the plugin weight specific entries more/less in the search results rankings?

nstCactus commented 1 year ago

Sorry for the late reply, we've been quite busy.

is there a way to force the plugin to ignore/suppress pages that throw errors when forcing it to reindex the whole site?

Could you describe, in a new issue, the problem you're facing so that I can investigate on this?

is there a way to have the plugin weight specific entries more/less in the search results rankings?

The plugin relies on Elasticsearch internal scoring to rank search results. What you could do is listen to the lhs\elasticsearch\record\ElasticsearchRecord::EVENT_BEFORE_SAVE event to mutate the search query in order to alter Elasticsearch results scores.