Products "Out of Stock" gaps in results

  • pseudo visitor
    Participant
    5 years, 3 months ago #8821

    Hello!

    The search results page shows a random number of results, no matter what value I input in settings. Some keywords show less results per page than others. “complete engine” for example shows less results per page. “door blue” shows more results. Is there any solution to this? Thanks!

    wpsolr
    Keymaster
    5 years, 3 months ago #8822

    Hello,

    Can you attach here a screen capture of the problem ?

    pseudo visitor
    Participant
    5 years, 3 months ago #8823

    It’s quite hard to screen shot the page as it’s very long.

    But if you search “complete engine”, you will see there are 11 results on page 1. If you go to page 2, there are 12 results.

    If you search “door blue”, there are 17 results on page 1. If you go to page 2, there are 17 results as well.

    The settings are set at 30 results per page.

    They seem to come in random numbers for some reason. There is to cache plugin active at the moment.

    wpsolr
    Keymaster
    5 years, 3 months ago #8824

    Thanks.

    It looks like the theme cannot display all the post types returned by the search, hence the “holes”.

    Did you index other post types than “product” in WPSOLR admin screen 2.2 ?

    pseudo visitor
    Participant
    5 years, 3 months ago #8825

    It’s just Products selected, but I found the issue.
    I indexed all products, including the Out of Stock ones. In WooCommerce I selected the option to hide the Out of Stock ones from the catalog. This is where the gaps are coming from. Rebuilding the index from scratch should solve the problem.

    pseudo visitor
    Participant
    5 years, 3 months ago #8826

    Hmmm, just did that, but it’s indexing all products, including Out of Stock. So it seems to be a conflict between WC option to hide the Out of Stock products and the pagination provided by WPSOLR. Do you have any ideas how to overcome this?

    wpsolr
    Keymaster
    5 years, 3 months ago #8827

    Add “_stock_status” to the indexed custom fields in 2.2, and reindex all your products

    Then add “_stock_status” to the facets in 2.4.
    Click on button “Override item labels”. Check option “Preselect In stock”.
    You can hide the facet in front-end with some css.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.