Custom data not showing
- media-artistsParticipant5 years, 5 months ago #11050
Hello,
I’ve got everything working so far. I have loaded the custom data from the database to the search. I can even filter on it. Except the title and such are not showing. What is the best way to create my own layout/template, where I can give the data I want to show.
Is there a way to change the shortcode search template? Like else I guess I have to use the regular WordPress search and use widgets to filter, right?
Should I make a new template for the standard WordPress search or is it possible to change the wpsolr’s search template?
Please give me some information / explanation on how to do this?
Some images to give some ideas, what I’ve done:
Kind Regards,
JasperwpsolrKeymaster5 years, 5 months ago #11051Hi Jasper,
Instead of using the WPSOLR Ajax template, let WPSOLR use your current theme search template. You will keep 100% control of what is displayed or not.
See: https://www.wpsolr.com/forums/topic/customize-the-wpsolr-ajax-search-template-shortcode/
media-artistsParticipant5 years, 5 months ago #11052Thankyou, for your reply!
I already have set WPSOLR use my current theme search template. But would I only have to change my theme search template?
And how do I get the facets and sort sidebar on the search page? Or is that only possible using widgets?
Would like to hear back from you!
Kind Regards,
Jasper
media-artistsParticipant5 years, 5 months ago #11053This is the setup:
wpsolrKeymaster5 years, 5 months ago #11054I already have set WPSOLR use my current theme search template. But would I only have to change my theme search template?
Yes, WPSOLR is now replacing in the background your WP_Query, and sends the results back to your search.php template (standard WP loop). Nothing to change, unless you want to.
And how do I get the facets and sort sidebar on the search page? Or is that only possible using widgets?
Exact. Add the WPSOLR sort and facets widgets to your search page. Follow our video tutorials for the TwentySixteen theme: https://www.wpsolr.com/guide/video-gallery-twentysixteen-theme-search-template/video-setup-demo-twentysixteen-theme-template-local-elasticsearch/ (many other tutorials are available too: https://www.wpsolr.com/wpsolr/search/s-tutorial+twentysixteen).
media-artistsParticipant5 years, 5 months ago #11055Thanks again for your quick respond!
Could you please tell me, why the sort, facets widget is not loading? Like if I take a random other widget it will work..
I know I am doing something wrong, but I really want to know what.
Hope you can help me!
Kind Regards,
Jasper
media-artistsParticipant5 years, 5 months ago #11058media-artistsParticipant5 years, 5 months ago #11060media-artistsParticipant5 years, 5 months ago #11062I guess the widgets only work on the search page, like now the widget is working but the results are not. Probably because it is still searching in the ‘wp_posts’ table and not my own custom data.. What is strange because it should load it from elastic search right?
media-artistsParticipant5 years, 5 months ago #11063This is when WPSOLR is deactivated:
wpsolrKeymaster5 years, 5 months ago #11064I understand now.
If you indexed custom data (data which is not a post type), facets and data will be retrieved from Elasticsearch. But WPSOLR will try to retrieve the $posts from the data IDs. Which he cannot, as those IDs are not from posts. Hence the empty results.
media-artistsParticipant5 years, 5 months ago #11066Thankyou, we are going to try to get the results straight out of elastic search. Because the data that we need is already indexed. Or do you have any other good solution that is compatible with WPSOLR?
You must be logged in to reply to this topic.