Home › Forums › Calendar Products › Events Calendar PRO › Modify the search query
- This topic has 6 replies, 3 voices, and was last updated 8 years, 6 months ago by Support Droid.
-
AuthorPosts
-
October 19, 2015 at 7:22 pm #1016081PabloParticipant
Hello guys,
I would like to change slightly the behaviour of the search functionality on the front end.
Basically, I would like that it searches not only in the title and descriptions of a post but also on the venue… so when you search for “XYZ venue”, those terms are not only searched on the post titles and descriptions but on the venues as well.
Let me know if I did not explain it well.
Thanks and regards,
Pablo
October 20, 2015 at 1:12 am #1016127BrookParticipantHello Pablo,
Thank you for clearly explaining your question.
That is going to be extremely complicated to do. The search aspect is handled by WordPress as part of the WP_Query. If you want to include events in the results based on words found in their venue, you will have to do a pretty hefty modification of WordPress search involving some SQL joins and many other modifications to the standard WP search query.
It would be easier to include the venue itself as a returned result when someones search text matches the venue title or content. If they clicked on the venue it would then show them a list of events for that venue. This will still requires some good knowledge of WP queries and themes to accomplish though. You would add an action to pre_get_posts, and check that $_REQUEST[‘tribe-bar-search’] is not empty(). From there you could change the post_type to include venues. However, the venues will not have pertinent information for search results, such as start/end times. So you will need to modify the templates to account for this, and likely force all search to be done with List View (which is yet another modification).
Either way it won’t be easy. I wish it was, but building or modifying search queries is one of the more difficult things to do. Does that answer your question?
Cheers!
– Brook
October 20, 2015 at 1:07 pm #1016370PabloParticipantHei Brook,
Thanks a lot for your kind answer. I was afraid that it was like that… so you confirm my hunches.
The guidelines that you provide are very helpful to me!
Thanks and regards,
Pablo
October 21, 2015 at 7:20 am #1016551BrookParticipantYou are welcome, Pablo. I wish I had better news there.
I know some users have found things like the Filter Bar to be helpful for improving search. The Filter Bar can add a list of all of your venues to the main events page, then a user can click on one or multiple to show events from those venues. Does that sound like it might help you here?
Cheers!
– Brook
October 21, 2015 at 10:01 am #1016625PabloParticipantHei Brook,
Thanks for your suggestion. It could work… but in fact I am looking for something more “inclusive”. The way you suggest would exclude those events out of the selected venues, and I still want that the search term functionality work as expected (include events from all the venues).
At the other hand, I think that it could be a good idea to suggest venues matching the search term in the moment that the user is writing… I think that could be user friendly and what the user expect to see nowadays.
Thanks a lot for your help!
Best regards,
Pablo
October 22, 2015 at 11:41 am #1017027BrookParticipantThat’s understandable Pablo. I think we would be interested in seeing if that is a popular feature suggestion. If this is something you would like to see in the calendar in the future please officially suggest it on UserVoice. Thanks for the feedback!
Cheers!
– Brook
November 6, 2015 at 6:05 am #1022509Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Modify the search query’ is closed to new replies.