Solved

Faceted search results returning different results locally from in production

kayluhb
Tourist
7 1 1

I'm building a site that has faceted searching enabled. Locally, I'm serving my theme using the shopify cli

 

 

 

 

shopify theme serve

 

 

 

 

When I run the faceted searches locally, the results are what I would expect, but when I have the exact same theme running in production, I get partial results or no results at all.

 

The theme I'm working on is still in development, so I'm unable to share it at this time.

 

Has anyone else run into this issue and know of a fix?

 

The term I'm searching on is

 

?filter.v.m.hmr.filter_material=926%20Silver,%20Enamel

Accepted Solution (1)

kayluhb
Tourist
7 1 1

This is an accepted solution.

I'm still not sure why the results were different for production vs. local, but it turns out the 

url_escape filter doesn't escape the comma.
 
Everything is fine when I replace the commas in my filter value with an escaped value.
 

 

{{ collection.url }}?{{ filter_value.param_name }}={{ filter_value.value | url_escape | replace: ",", "%2C" }}

 

View solution in original post

Reply 1 (1)

kayluhb
Tourist
7 1 1

This is an accepted solution.

I'm still not sure why the results were different for production vs. local, but it turns out the 

url_escape filter doesn't escape the comma.
 
Everything is fine when I replace the commas in my filter value with an escaped value.
 

 

{{ collection.url }}?{{ filter_value.param_name }}={{ filter_value.value | url_escape | replace: ",", "%2C" }}