Comments on: WP Search with Algolia Tips and Tricks https://webdevstudios.com/2021/02/09/wp-search-with-algolia/ WordPress Design and Development Agency Mon, 15 Apr 2024 15:56:35 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Laura Coronado https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-162898 Thu, 21 Sep 2023 20:45:57 +0000 https://webdevstudios.com/?p=23273#comment-162898 In reply to David.

Hi, David. Thanks for using WP Search with Algolia. At the WordPress plugin repo, we have a Support page where you can submit your request for support and interact with the developer directly. Thank you. https://wordpress.org/support/plugin/wp-search-with-algolia/

]]>
By: David https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-162872 Thu, 21 Sep 2023 14:24:26 +0000 https://webdevstudios.com/?p=23273#comment-162872 I am facing the issue that the plugin writes me the same content to almost each post. The title and all other parameters are different, but the “content” is the same.

]]>
By: Laura Coronado https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-159078 Fri, 21 Jul 2023 15:28:59 +0000 https://webdevstudios.com/?p=23273#comment-159078 In reply to MICHAIL KAIPIS.

Hi, Michail. Thanks for using WP Search with Algolia. At the WordPress plugin repo, we have a Support page where you can submit your request for support and interact with the developer directly. Thank you.

]]>
By: MICHAIL KAIPIS https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-159071 Fri, 21 Jul 2023 11:28:00 +0000 https://webdevstudios.com/?p=23273#comment-159071 hello my name is Michail Kaipis and i am a software developer, i havent figured out how to use your plugin to include filters in my search

i am trying to use your plugin with algolia search in wp and i want to add search filters like for a spesific category, i looked that the algolia api has an option for this to happen with php for example:

// Search the “category” facet for values matching “phone”
// in records having “Apple” in their “brand” facet.
$index->searchForFacetValues(“category”, “phone”, [
‘filters’ => ‘brand:Apple’
]);

i am wondering if its posible to make the filtered search from your plugin directly
if its possible please let me know how its done

thanks a lot for your time
Michail

]]>
By: Michael Beckwith https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-134023 Wed, 30 Mar 2022 20:34:18 +0000 https://webdevstudios.com/?p=23273#comment-134023 In reply to Jay West.

Hi Jay,

Can you provide what code you’re using thus far? It’ll help us make sure we’re providing accurate amended snippets to help here. For example if you’re adding this via a callback on say the `algolia_post_shared_attributes` hook from Darren’s example above.

Going to assume a moment, but if you have something like this:

“`
$geodata = get_field( ‘geodata_field’, $post->ID );

if ( ! empty( $geodata ) ) {
$attributes[ ‘_geoloc’ ] = $geodata;
}
“`
And `$geodata` is that JSON data directly, then I think you’d want to do this:

“`
$attributes[‘_geoloc’][] = $geodata;
“`

This turns the `$attributes[‘_geoloc’]` index into a nested array itself.

If your latitude and longitude are stored in their own then perhaps something like this:

“`
$geolat = get_field( ‘geodata_lat’, $post->ID );
$geolng = get_field( ‘geodata_lng’, $post->ID );
$geodata = [ ‘lat’ => $geolat, ‘lng’ => $geolng ];
$attributes[‘_geoloc’][] = json_encode( $geodata );
“`
This would construct an array with the key/value pairs, and then encode and store in the same way on the returned `$attributes`

]]>
By: Jay West https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-133964 Tue, 29 Mar 2022 21:00:55 +0000 https://webdevstudios.com/?p=23273#comment-133964 I’m using this successfully – thanks for the article.

I am having One issue though and wondering if you have any thoughts –

https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/

I’m trying to pass geolocation fields from ACF like:
“_geoloc”: {
“lat”: 40.639751,
“lng”: -73.778925
}

I’m not sure how to build a nested array like this based on your instructions above.. Any thoughts?

]]>
By: Michael Beckwith https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-131797 Wed, 23 Feb 2022 22:42:32 +0000 https://webdevstudios.com/?p=23273#comment-131797 In reply to Minh.

Just making sure I’m understanding, you’re wanting to change where the search takes place in a given query, because the SKU is long?

Based on the link provided, thank you for that, I think we’d want to get you adding in the sku to shared attributes spot, and them parsed out similar to what the docs page shows where you’re breaking it up into smaller chunks. Then once those are indexed, add that new index to the searchable parts in your Algolia dashboard.

]]>
By: Minh https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-131349 Fri, 18 Feb 2022 07:08:16 +0000 https://webdevstudios.com/?p=23273#comment-131349 In reply to Michael Beckwith.

Here it is!
https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/how-to/how-can-i-make-queries-within-the-middle-of-a-word/
Actually, i just wanna search for SKU. But my problem is sku is too long ( more than 6 characters )… that why i wanna change it!
Thanks bro!

]]>
By: Michael Beckwith https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-131333 Fri, 18 Feb 2022 01:18:06 +0000 https://webdevstudios.com/?p=23273#comment-131333 In reply to Minh.

Hey Minh,

Can you link us to the article you are referring to? I’m not sure about this one offhand and how to possibly help with it. It’s potentially an Algolia Dashboard configuration change needing made, outside of the WP Search with Algolia portion of the overall process and integration.

]]>
By: Michael Beckwith https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#comment-131332 Fri, 18 Feb 2022 01:14:48 +0000 https://webdevstudios.com/?p=23273#comment-131332 In reply to Daz.

Hi Daz,

Something like the code in the following GitHub gist should help.

https://gist.github.com/tw2113/64c1598758f0540265dce8cbd7aa590a

This checks the current product/post getting indexed, and retrieves if it’s marked as a hidden catalog item for WooCommerce. If it is considered hidden, we return false to make it not get indexed. Otherwise it should get indexed.

]]>