Wrong search.results_count number

Solved
Highlighted
Tourist
4 1 0

If I perform a search such as: myshopify.com/search?q=foo&type=product

the search.results_count is much higher than the search.results entries (and it's not a pagination issue).

 

For example,  search.results_count might return 15, but search.results will only have 8 entries.

 

I have since tried deleting all products from the cms. Now when I do a search I still get non-zero search.results_count numbers, but search.results is always empty. The number that search.results_count returns depends on the query, and this seems to match what used to be in the cms for products. It seems that the results_count number is using old data somehow?

 

Here is my simplified search results page:

 
{% paginate search.results by 20 %}
  <script>console.log({{search.results_count | json}});</script>    
<script>console.log({{search.results | json}});</script> {% endpaginate %}

 

Any ideas? Is there a way to force a reindex of the products for search?

0 Likes
Highlighted
Shopify Expert
9812 92 1574

Can you link to a real search results page? Search can be augmented by JavaScript, Liquid or offloaded to third party tools. Would be good to see it in action clearly showing the inconsistency.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Tourist
4 1 0

Unfortunately it is currently behind a password wall.

I have tried switching to a clean version of the debut theme and it still has the same issue.

Does that rule out js and liquid?

I have also tried removing all apps, and the issue persists. However, there may be some residual change left in the wake of these apps. I don't think there's any way I can check that..

0 Likes
Highlighted

Success.

Tourist
4 1 0

This got resolved after getting in touch with the Shopify support staff directly.

As I suspected, it seems to have been an issue with a corrupt index. They had to fix them for me from their end.

Here is what I could get out of them about it:

 

This looks to have been resolved by our developers they have find a solution by pushing the data and refreshing it from their side. With that said this is something that had to be brought up to them to further diagnose and apply those options to make it work. It appears that that the case on this has been resolved entirely.

Posting here in case someone else comes across the same issue.

0 Likes