algolia / algoliasearch-wordpress

❌🗑🙅‍♂️ Algolia Search plugin for WordPress is no longer supported. Please use our API client guide instead
https://www.algolia.com/doc/integration/wordpress/getting-started/quick-start/
GNU General Public License v2.0
358 stars 114 forks source link

Index only relative link to post #774

Open alexandre-geronimo opened 6 years ago

alexandre-geronimo commented 6 years ago

We deployed Algolia on a Wordpress website which is generated in static on a production environment. Algolia autocomplete works fine on a static version. The issue is that all the permalinks indexed by Algola are using the whole URL including the domain name of dynamic version which is different from the static one. Is there any way to index only the relative part of the contents permalinks ?

rayrutjes commented 6 years ago

As of today we chose to index absolute URLs because this makes it easier to build federated searches. This has also some drawbacks like the one you are facing.

You can override the url at indexing time by using a hook. Here is an example you can adapt: https://gist.github.com/rayrutjes/494ba3acffdba7cb1da0c23c6f45236b

I hope that helps.

alexandre-geronimo commented 6 years ago

Hi, thanks a lot for your quick answer, it will help :)