I have a search page where I do the search by using various filters. There's also one free text search field there which will use relevanssi for searching.
This used to work without an issue but I realised today that some of the filters don't work at all. If I use the free text search field and rely on relevanssi, then all search filters work without an issue.
The problem occurs when I use the custom fields to search. Searching based on taxonomies work without an issue so far.
I attached the screenshot of the filter definition if that makes things easier
Is this a known issue?
Is there any documentation that you are following?
Is there a similar example that we can see? hidden link
Try filtering by age, for example select 4 from the dropdown. What it is supposed to do is to find all event where min age <= 4 <= max age. You'll see in the results that records that are outside of the age range will still exists on the search results.
Try adding some text into the "What are you looking for?" text field, you'll see that it is working as it should.
I was able to apply a workaround to "fix it" on live website by forcing a default value for the free text search, so visitors don't experience a big issue, but you can still see the problem on the staging website that I linked you in previous post
I'm not sure what the issue is here. I set up a comparable test on a clean test site just now, and everything works as expected. The custom field filters work, irrespective of whether any text is entered in the text search box or not.
I visited your search page, but I'm not sure what I'm looking at.
The filter for age lets you choose a single value (e.g. 10), but the list of posts shown output age as a range (e.g. 4 - 13), so they don't appear comparable.
If you would like us to investigate the issue on your site can we get credentials from you?
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.
Thank you for the support on this one. It was really strange I agree as it was working without problems before. I realised that's because of a code we introduced some time ago and we broke the search without realising.
Basically, I had a piece of code where I was trying to sort the order of the results, but I ended up overriding the whole search criteria. This was running in a "wpv_filter_query" hook, which was why the search was ok when I used relevanssi.