Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Drop Down Search multiple values with Custom Fields search.
- This topic has 6 replies, 2 voices, and was last updated 5 years, 9 months ago by
Ernest Marcinko.
-
AuthorPosts
-
August 24, 2020 at 7:45 pm #29076
ChrisBCG32
ParticipantHello,
I’m trying to make an “Advanced Search” by utilizing custom fields in Ajax Search Pro under Frontend Search Settings > Custom Fields.
Some of the items that are searchable have custom fields with more than one value applied to it. (ex. The Flying Sword has
condition immunity: charmedas well ascondition immunity: poisoned.)One of the goals is for users to be able to add multiple values in the search to better refine their results. (ex. If they enter
poisonedin the condition immunities field, they get multiple results including the Flying Sword and the Imp. But if they addcharmed, the imp should be removed from the results as it does not have this value applied.)We’ve been fiddled around with the settings, and when Drop-down values logic is set to
OR, it looks like when multiple values are selected it will show all results that meet at least one of the selected values.My goal is to make it so that if more than one value is selected for the same custom field, the only results that show are ones that match all of the applied criteria. So we tried setting Drop-down values logic to
AND, however this did not work as expected. Instead once a second value is applied in the search no results come up.August 24, 2020 at 7:47 pm #29077ChrisBCG32
ParticipantI thought I provided screenshots, but looks like they didn’t carry over. Sorry if they did and I’m sending duplicates.
August 25, 2020 at 1:23 pm #29094Ernest Marcinko
KeymasterHi,
Thank you very much for your detailed ticket. I was able to replicate this setup and found the cause. Generally it is not a common practice to use multiple instances of the same custom field by name to store multiple values, but WordPress allows that, so it should be fine.
The problem with this is, that the plugin query applies this logic one a single field level – so the value1 AND value2 means, that it should match a single existing field value, not one value in one field, and another one in another field etc..I was able to come up with a possible solution, but I will have to extensively test it before a final release. We have a minor bugfix release planned for this week, a solution to this should be in it as well (by adding a new logic option).
You will get a notification from codecanyon once the update is ready, should take a few days, if that is okay for you.August 25, 2020 at 6:25 pm #29103ChrisBCG32
ParticipantHey Ernest!
No worries, I work in support myself and when I’m not doing that I work with artists, so I always try to give as much detail as possible!
I’m so happy to hear that you were able to find a solution. And absolutely, development takes time, I’m more than content with waiting a bit. In the meantime I can just keep working on other parts of the site.
Have a great day Ernest!
August 26, 2020 at 9:52 am #29121Ernest Marcinko
KeymasterThank you, and a great day to you too!
August 30, 2020 at 6:40 pm #29184ChrisBCG32
ParticipantJust got the update! Thank you so much! Feel free to close this ticket! 😀
August 31, 2020 at 9:47 am #29195Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Drop Down Search multiple values with Custom Fields search.’ is closed to new replies.