Ivory Search › Forums › Support › Not able to select custom fields to search
Tagged: Custom Fields
- This topic has 6 replies, 2 voices, and was last updated 2 years, 1 month ago by Ivory Search.
You must be logged in to create new topic or reply to the topic. Click To Login
- AuthorPosts
- September 30, 2022 at 4:09 PM #13286
Before using Ivory Search I’d added some code to my functions.php so that I could search Media photos by some custom fields I’d created for them. I think Ivory Search (understandably) overrides that code. This would be OK in theory, because I can ask Ivory Search to search those fields. But I don’t see my custom meta_keys listed in the “Custom Fields” part of the Default Search Form settings. It lists these fields:
book_byline
geo_public
menu_text
sharing_disabled
switch_like_statusBut none of the other fields I’ve used on images. Looking into the wp_postmeta table, the meta_keys I’ve used on images all start with an underscore (e.g.
_mysite_ref
,_mysite_date_taken
) – is this why they’re not showing up as options in the form? Is there a way to get them to show up? Thanks. - October 2, 2022 at 1:14 PM #13295
I hope you are well today and thank you for your question.
It seems your shared custom fields are private and 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 SupportAttachments:
You must be logged in to view attached files. - October 9, 2022 at 5:56 PM #13377
Thank you so much for this, and apologies for not replying sooner ā I must have missed the notification email.
Unfortunately, adding that to my
functions.php
and selecting a single custom field name to search, results in search queries taking around 130 seconds to complete!I’m not clear why it takes so long, or if there’s an index I can add to the database that would drastically speed it up. This is the search query (searching for “myterm”):
- October 9, 2022 at 5:59 PM #13378
Hmm, all my SQL etc got stripped out! I’ve tried attaching it as a text file instead…
Attachments:
You must be logged in to view attached files. - October 9, 2022 at 9:17 PM #13381
You don’t need to add the shared custom plugin code in to the functions.php file because you can use it directly by activating it on your website.
To speed up the search, please build the index from the plugin index option and use the Inverted index search engine in the search form as shown in the below screenshots.
- October 10, 2022 at 10:13 PM #13394
Aha, I missed the index entirely!
I also had to scroll down the “Index” page and, in “Custom Fields” check “Index all custom fields values” before it searched them. It seems to work great now.
Thank you so much for your help.
- October 11, 2022 at 2:46 PM #13406
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:
Iād really appreciate that. š
And if I can be of any further assistance please don’t hesitate to ask.
- AuthorPosts
You must be logged in to create new topic or reply to the topic. Click To Login