Skip Navigation

[Resolved] wpv_filter_query doesn't work when ajax search is done

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 7 replies, has 2 voices.

Last updated by amrinderS 3 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#2154245

I am trying to:

$query_args['ep_integrate'] = true;

to the toolset view search and it works on load but when i change search filters, it seems to ignore it.

hidden link

I have integrated elastic search on load to index, but on search this code is not working.

Instead, default toolset search runs on ajax.

#2154257

Hello and thank you for contacting Toolset Support.

To better assist you with this issue, I'd like to know more details about it. Can you share the whole snippet of custom code?
Can you try it with a higher priority in the add_filter call?

Can I take a closer look at your website and check this further? Your next reply will be private to let you share credentials safely. ** Please tak a database backup before sharing credentials**

Can you also share a test scenario where I can see the issue? Please give an example to clearly see the issue.

I might also need to take a copy of your website for further analysis. Let me know if that's fine with you.

#2154287

Thank you for the credentials, I confirm they are working for me. And the custom code in the website has this argument commented, check this screenshot hidden link

I will also need a test scenario to see to issue. Please provide clear steps to follow to see the issue, otherwise, I can't really guess:
1. I go to xxx.
2. I do xxx.
3. I expect to get xxx.
4. Instead, I get xxx.

#2154293

Hello Jamal,

Okay so on load of the page, check this screenshot hidden link

Recheck the code now. I was testing.
When i change filters, like search it should show the same and use elasticsearch and should hook this code on ajax search as well.

$query_args['ep_integrate'] = true;

Try to add any debug in the code and on ajax it doesn't fires.

#2154295

The code does fire. Check this screenshot, I added an echo call and I can see it in the response of the AJAX request hidden link

I don't think that Query Monitor(from your screenshot) will report what happens during AJAX calls. So, I would need a test scenario that demonstrates that Elasticsearch was not used during the AJAX call. Can you provide steps to follow to reproduce the issue and check the outcome?

#2154297

Yes, it shows it on ajax. So this means that the code is being added in the query ? Can you debug query and check ?
I am following this for elasticsearch and to index the results. hidden link

#2154305

I'll do my best to analyze any issue. But, right now, I don't see any issue. That's why I am asking, again, for steps to follow to see any actual issue. Something like:
1. I go to xxx.
2. I do xxx.
3. I expect to get xxx.
4. Instead, I get xxx.

Otherwise, I'll remain helpless.

#2159163

My issue is resolved now. Thank you!