Custom data not showing

Tagged:
  • media-artists
    Participant
    5 years 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:

    View post on imgur.com

    View post on imgur.com

    Kind Regards,
    Jasper

    wpsolr
    Keymaster
    5 years ago #11051

    Hi 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-artists
    Participant
    5 years ago #11052

    Thankyou, 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-artists
    Participant
    5 years ago #11053

    This is the setup:

    View post on imgur.com

    wpsolr
    Keymaster
    5 years ago #11054

    I 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-artists
    Participant
    5 years ago #11055

    Thanks 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..

    View post on imgur.com

    I know I am doing something wrong, but I really want to know what.

    Hope you can help me!

    Kind Regards,

    Jasper

    wpsolr
    Keymaster
    5 years ago #11057

    Please copy here your WPSOLR screens:
    – 2.1
    – 2.2
    – 2.4
    – 3. Send your data

    media-artists
    Participant
    wpsolr
    Keymaster
    5 years ago #11059

    It looks good. What is shown on your search page? ( /?s= )

    media-artists
    Participant
    wpsolr
    Keymaster
    5 years ago #11061

    And if you deactivate WPSOLR?

    media-artists
    Participant
    5 years ago #11062

    I 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?

    View post on imgur.com

    media-artists
    Participant
    5 years ago #11063

    This is when WPSOLR is deactivated:

    View post on imgur.com

    wpsolr
    Keymaster
    5 years ago #11064

    I 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-artists
    Participant
    5 years ago #11066

    Thankyou, 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?

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.