Skip Navigation

[Resolved] Search not performing as expected

This thread is resolved. Here is a description of the problem and solution.

Problem:
Search not working correctly on installed Classifieds site for price field

Solution:
You should check your view that displays the search filter and double check that correct "Query filter" is added for your each filter at "Query filter" section.

You can find the proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/search-not-performing-as-expected/#post-616723

Relevant Documentation:

This support ticket is created 6 years, 9 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.

Our next available supporter will start replying to tickets in about 5.04 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by coetzeeG 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#616053

Hi there,

I modified the search to include 2 additional taxonomies, region and condition.

See here: hidden link

Now when you click on the drop down for condition and select new or used there should only be one ad, but all the ads show up.

Also when I enter a price I get no results.

What did I break?

#616221

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to know what clause you would like to apply between all filters? By default with multiple taxonomy filter it will apply "AND" clause - do you want to apply "OR" clause?

#616227

In your opinion, what would be the best solution to make the search work?

What solution would enable me to use all the filter fields together, or just one at a time?

If you would like to have a look at the search code I can provide access.

#616262

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - its depends on you that what clause you would like to apply with multiple taxonomy filter "And" or "OR".

Based on your requirement you need to set the "And" or "OR" clause, lets say if I chose X from taxonomy dropdown A and Y from taxonomy dropdown B, how you want to display the result?

posts with taxonomy term X and Y
OR
posts with taxonomy term X OR Y

#616272

oh ok, I see what you mean.

In that case AND would be the one.

Will this work for the max price field as well, because at the moment when I enter price value I get no results?

#616300

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - it should work with every filter but you need to make sure how you want to combine all conditions with each filter.

How you are entering the price value? You need to enter only numbers with your price field.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#616715

Hi Minesh,

Have you had any luck?

I've tried some more reading and troubleshooting but to no avail.
Apologies for following up so soon.

#616723

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now, there is multiple filter added for "price" field, I have removed one duplicate one and I can see your view is showing correct results.

Could you please confirm.

#616773

Hi Minesh,

Yes, the price field is now working correctly, thank you very very much, I understand now what went wrong there.

Just one more question if I may. I have another field in the search called "item-condition" (located next to max price), it's a taxonomy with 2 categories, New and Used.

I set all listings to New except one, but when I select Used from the drop down it shows all listings and just the one it should.

Could you perhaps have a look and tell me if I did something wrong there?

#616781

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - Again for that taxonomy filter the query filter was not added to "Query filter" section of the view.

Condition slug in one of those set by the URL parameter wpv-item-condition
eg. <em><u>hidden link</u></em>

I can see now its working. Could you please confirm.

#616793

Minesh, thank you very much for your help.

I learned a few new things here today and also where I went wrong, thank you for the help, really appreciate it.

Everything is working 100%.