Ivory Search › Forums › Support › NO search results after adding additional info into index
- This topic has 3 replies, 2 voices, and was last updated 1 month, 3 weeks ago by Ivory Search.
You must be logged in to create new topic or reply to the topic. Click To Login
- AuthorPosts
- September 19, 2024 at 12:44 PM #21640
I use Ivory search to search in WooCommerce products. I want to add some fields created with Carbon Fields into search index. Because all of them are private meta fields i decided to add content of this field into post content via hook.
So i added this function:
add_filter('is_index_post_content', 'crb_add_field_to_search', 10, 2);
function crb_add_field_to_search($to_index, $post): string
{
$to_index .= carbon_get_post_meta($post->ID, 'crb_long_name');
return $to_index;
}After creating index i can see words from this field in wp_is_inverted_index table. I can find them assosiated with desired product. But search results doesn’t show.
Attachments:
You must be logged in to view attached files. - September 19, 2024 at 12:51 PM #21644
I hope you are well today and thank you for your question.
By default, the plugin doesn’t search private custom fields.
You can make it search private hidden custom fields by using the shared small custom plugin or by using the code from it.
Best regards,
Ivory Search Support - September 19, 2024 at 1:29 PM #21646
This helped! Thank you very much
- September 20, 2024 at 2:49 PM #21664
You are always welcome, I’m glad I was able to help you with this matter. There is no obligation but by your kind words I wonder if I could trouble you to leave a review based on this experience here:
https://wordpress.org/support/plugin/add-search-to-menu/reviews/?filter=5
I’d appreciate that. 🙂
If I can further assist you, please don’t hesitate to ask.
- AuthorPosts
You must be logged in to create new topic or reply to the topic. Click To Login