Skip Navigation

[Resolved] creating full text search of custom field, clicking result redirects to url

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 0 replies, has 1 voice.

Last updated by davidm-13 1 day, 2 hours ago.

Assisted by: Minesh.

Author
Posts
#2805925

Have a custom post type containing custom fields eng-name (single line) and eng-name-url (url)
I want a full text search box to search eng-name (or part of) which produces a dropdown of results, when a result is selected then redirect to the eng-name-url

What is the link to your site?

hidden link

#2805952

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

We offer integration with Relevanssi.

Here is the Doc that shows information how you can implement full text search.
- https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/

Basically, when you search with any keyword - it will display the results and with that result you can display the "eng-name-url" field or whatever field you want to display.

There is no such option to display it as dropdown as you want but you can list the found post and with those found items you can display the "eng-name-url" field.

#2805963

Hi Minesh, Thanks for your reply.
I've created custom fields, built the Relevanssi indexes and added a view and but the search isn't working, - returns "No items found".
Appreciate it if you could take a look.

Thanks

#2805964

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share all required details what custom field you created and where you added the text search and share admin access details.

Also, what search keyword I should use that should produce the results and what is your expected results.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2806441

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It seems you forget to share the admin username. Can you please share the admin username?

I have set the next reply to private which means only you and I have access to it.

#2806457

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I'm not sure why you added the Loop Editor code to "Search and Pagination" section.

You should try to build a normal view.

When you search with Text search it also requires submit button.

#2806594

ok, I created a new view - eng-name-srch - with the changes you suggested.
It's still not redirecting to eng-plant-url when clicking on a search result.
Also I don't want to see a list of all Eng-name before pressing Search button

Thanks for your help

#2806606

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please check your view:
=> hidden link

To redirect the English name to "eng plant url" link, I've adjusted the code to your view's loop template as given under:

<a href="[types field='eng-plant-url' output='raw'][/types]">[types field="eng-name"][/types]</a>

Now, regarding search, for text search you will require to use the custom search option "Full page refresh when visitors click on the search button" as text search requires submit button and you also want to hide the result until user search.

when page loads first I've added the view as given under to your home page content template:
=> hidden link

To display the form:

[wpv-form-view name="eng-name-srch" target_id="self"]

And to display the result only when user submit the search:

[wpv-conditional if="( '[wpv-search-term param='wpv-wpcf-eng-name']' ne '' )"]
        [wpv-view name="eng-name-srch" view_display="layout"]
[/wpv-conditional]
        
#2806613

I've succeeded to make the results clickable and redirect to the correct url (by inserting a link in the View output editor) but between clicking the search button and receiving result(s) takes a long time (around 8 seconds). There's around 640 english name posts, any ideas how to speed this up?

Thanks

#2806614

I see what I thought was my fiddling around was actually you fixing the problem.
Looks good

Thanks

#2806616

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Great - you are welcome to mark resolve this ticket.

#2806637
engView.jpg

The attached is for English Name Search post type, but also includes custom fields for Medicinal Plants and Complaints how do I remove these

#2806696

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the custom field group listing page:
- hidden link

And I found that the custom field group you mentioned was set to display with ALL post types. Now, I've set the "Complaint" custom field group to display with "Complaint" post type.

You can set from custom field group edit page that you want to display the custom field group with what post type.

Please open a new ticket with every new question you may have. Thank you for understanding.

#2806737

Thanks very much for your help