Forums › Forums › Search & Filter Pro › Post Meta field filter works only on one meta field
- This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by Ross.
-
Anonymous(Private) May 12, 2015 at 8:58 pm #17330
Hi Ross, I have a search form configured to search a custom post type ‘Recipe’ with a couple custom taxonomies and 2 post_meta fields set in the UI.
The post_meta fields ‘related_products’ and ‘related_friend’ contain a post_ID of their respective post, Product and Friend. The search will return results for the related_products meta field but not for the related_friend meta field. I have included the post meta from the database on the same post ID. The search form is on the Recipe post page http://sweeteners.wpengine.com/recipe/stevia-buttercream-frosting/
From the database = no search results
meta_id 8737
post_id 493
meta_key related_friend
meta_value a:1:{i:0;s:3:”492″;}From the database = search results
meta_id 4744
post_id 493
meta_key related_products
meta_value a:1:{i:0;s:3:”495″;}Post 493 is a recipe post type – http://sweeteners.wpengine.com/recipe/stevia-buttercream-frosting/
post 492 is the related_friend – http://sweeteners.wpengine.com/friend/katherine-clapner/
post 495 is the related_products – http://sweeteners.wpengine.com/product/organic-stevia/You can see the post relationships for related_friend and related_product on the recipe post as well.
Any insight why the related_friend post meta does not return any results would be greatly appreciated.
Ross Moderator(Private) May 17, 2015 at 7:35 pm #17699Hi Jayson
As I can see from above, you meta fields are serialised:
a:1:{i:0;s:3:”495″;}
This is extremely bad for searching, it would be much more efficient if the value was:
495
– no need for the serialisation.Anyway, if you are using serialised data, then sometimes S&F had a tough time detecting it (it wasn’t 100% accurate).
I’ve just emailed you a beta update (so remember to clear your cache after installing) – which allows you to manually define if the field is serialised (you can find it in the “choice” tab of your meta field) – please test this and let me know if your problem is resolved?
Thanks
-
AuthorPosts