Null Custom Field Dropdown Value / Broken Exclude Taxonomy

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Null Custom Field Dropdown Value / Broken Exclude Taxonomy

This topic contains 6 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 years, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7123
    choward
    choward
    Participant

    Hi Ernest,

    We have two issues:

    1. Is it possible to have a null (empty) value in a custom field dropdown so that a search can still be executed without a selection being made in the dropdown list?

    2. Since upgrading to WP 4.4 it seems that the Advanced Options | Exclude taxonomy terms stopped working correctly. See the image attached. The ‘documents’ category is excluded, but is still checked. It was working correctly prior to update. Perhaps this is a bug.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #7125
    choward
    choward
    Participant

    The second image is attached. ‘Add another file’ didn’t seem to like Chrome 47.

    Attachments:
    You must be logged in to view attached files.
    #7132
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. NULL values won’t work (meaning the custom field is not defined for the post) due to an optimization. A possible workaround is to have at least a “space” character as the value for the custom field, and have something like this as the first selection:

    ||None

    2. I might need back-end and FTP details to check on this one. I’m not able to re-create the issue on my test environment.

    To safely add the details you can edit your initial post in this thread, or upload a .txt file attachment. Both methods are safe and visible to only me and you.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #7143
    choward
    choward
    Participant

    Hi Ernest,

    Thanks for the great plugin.

    1. Basically, our problem is that we have a custom fields for data like ‘event’ and ‘presenter’. The custom field dropdown works fine if we simply have a list of ‘2014,2015,2016’ but that forces the search to one of the values which breaks the search for users that don’t use the advanced options. I assumed there was a ‘null’ value that basically told the search to ignore the field, basically if “null || (blank)” which would automatically be bypassed. If that’s not possible, we’ll have to think of a more creative way to implement that type of filter.

    2. Credentials attached for our development server. This is probably something simple that we’re overlooking.

    Thanks again for the help!
    Charles

    Attachments:
    You must be logged in to view attached files.
    #7145
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. Well, if you want to filter a single numeric value (I’m guessing year?), then as a possible solution might be to not use the “EQUALS” operator, but rather “LESS THAN” and have a bigger number as the default value, like so:

    3000||All years**
    2017||2016 and before
    2016||2015 and before

    and so on..
    In the first case each record, no matter which year is less than 3000 so the result set is not reduced. For the other ones, the year must be bigger by 1, as the “less than” operator is not inclusive.
    The downside of this solution is that it does not filter by an exact year.

    Another possible solution is to use a <span class=”code”>Range Slider</span> type, and have the low – high values at the lowest and highest date.

    I’m working on a solution to accept unset/null values, but it needs lots of testing, as the current solution has a great performance and I do not want to give up that under any circumstances 🙂

    2. The configuration looks all right, there is definitely a bug somewhere. Can you also give me temporary FTP access to the development environment? I would like to debug the search code to find why is that happening. Weirdly it works with the categories, but not the taxonomy terms.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #7150
    choward
    choward
    Participant

    Hi Ernest!

    1. Unfortunately, text fields are the more significant concern. The static list to generate a dropdown isn’t a big deal and from the performance perspective is probably a good idea. We’d like to allow a filter for presenters and series names whose dropdowns would look like this:

    Null || [Empty]
    Presenter One || Presenter One
    Presenter Two || Presenter Two
    Presenter Three || Presenter Three

    The default selection would always be [Empty] which would allow searching across the full post set, but any other selection would offer a filter. I figured this was built into the custom field search so that when the search is triggered if the value selected is equal to “null” it bypasses the filter altogether, otherwise it performs the search as usual with the filter.

    2. Credentials are attached as requested. Let me know if you have any issues accessing the server.

    Attachments:
    You must be logged in to view attached files.
    #7160
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. I’m close to releasing an update, but I think first I will investigate if there is any way I can implement a bypass for null values. I know I tested a few possible solutions before, but those were absolutely killing the overall performance, maybe I can find something better this time.

    2. I have found the problem. The function checking the term ids within the exclusions array was defined incorrectly. I’ve fixed it and putting it to the upcoming version of course. It’s a minor bug, nothing serious 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.