Override default template of search results

  • wpsolr
    Keymaster
    2 years, 9 months ago #27334

    In screen 2.1, you can activate the WPSOLR logs and see the query to your search engine.

    techniquepix
    Participant
    2 years, 9 months ago #27335

    In WPSOLR logs there are only the posts I want. No post from post types that I haven’t added to index. So I suppose the query must be modified after WPSOLR. I’ll check that, and I’ll let you know.
    Thanks

    techniquepix
    Participant
    2 years, 9 months ago #27339

    Hi,
    I have installed the Query Monitor plugin to check the different queries. And it seems that WPSOLR query is done, and AFTER Elementor Pro does one another. Is the expected behaviour ?

    Thanks

    wpsolr
    Keymaster
    2 years, 9 months ago #27340

    WPSOLR will replace the archive main query, which is why it is necessary to use an Elementor archive template (search, or category, or post type).

    After that, Elementor will query the data it requires to display the content.

    techniquepix
    Participant
    2 years, 9 months ago #27344

    Hi,
    I do use the search archive template of Elementor. And I have the “archive posts” widget.
    WPSOLR request is made, but it’s replaced by the one from Elementor Pro later. It’s as if Elementor made its own request and didn’t use the archive main query.
    I tried without WPSOLR plugin. And it’s the same behaviour. I doesn’t have the same search results with Elementor archive template and without it. The posts displayed are not the same. As if Elementor is not using the main query.

    I think I’ll use the search template from my theme, and not the Elementor archive template. It will fix my issue.

    Thanks

    wpsolr
    Keymaster
    2 years, 9 months ago #27345

    I understand.

    I don’t know if it can help, but if you add the field ‘type’ on your facets, you can select some of your post types that will be used to pre-filter your search.

    techniquepix
    Participant
    2 years, 9 months ago #27347

    I don’t use facets. But it’s working fine with the search template from my theme. I have the expected results. So it’s ok.
    Last question : it’s a multilingual site with WPML. Is it necessary to use the WPML addon of WPSOLR ? I didn’t activate it and I have only one index (FR by default), and the results in the other languages (like EN) seem to be correct. Is it ok or should I create an index for each language ?

    Thank you

    wpsolr
    Keymaster
    2 years, 9 months ago #27348

    Indeed, you can decide not to activate WPML, and index all your posts in the same index.

    But with the WPML add-on, you will be able to create one index per language, with specific language analysers (just a selection for Elasticsearch and Algolia, but requires manual specific settings for Solr in Solr admin and Solr server files).

    But also, with the WPML add-on, all texts related to search can be translated with the WPML string module: all texts in the search template, all facets names and even contents. If you have a product colour attribute, “red” facet will appear on “en” search page whilst “rouge” will on “fr” search page.

    WPML add-on Documentation: https://www.wpsolr.com/documentation/configuration-step-by-step-schematic/activate-extensions/wpml-add-on/

    techniquepix
    Participant
    2 years, 9 months ago #27350

    Hi,
    Thank you for this clarification.

    Best regards

Viewing 9 posts - 16 through 24 (of 24 total)

You must be logged in to reply to this topic.