Search logic

This topic contains 4 replies, has 2 voices, and was last updated by mmousfi mmousfi 7 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2986
    mmousfi
    mmousfi
    Participant

    Hi
    I just bought the Pro version having tried the free version. I am having a problem with the AND search logic. When I search for two terms written next to each other in the search box – eg: “vinyasa dubai” (which are values found in custom fields called “practice” and “city”), the returned result set is not mutually exclusive to the search terms ie: the result set includes any post with the custom field values or “vinyasay” or “dubai”. Therefore the logic that seems to be in the works is the OR logic and the AND logic. I hope this is clear.

    I hope you can respond as soon as possible please.

    Thank you
    Marwan

    #3007
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I understand. This functionality was intentionally left out because of performance issues. Custom fields can make a huge difference. However if you want, you can still make it work.

    I’ve made a code change, so it might work:
    1. Open up the wp-content/plugins/ajax-search-pro/includes/search_content.class.php file
    2. Make a backup of it’s content.
    3. Replace it’s content with this: http://pastebin.com/raw.php?i=iQTh8jKc
    4. Save it and try it.

    I’m not sure if ti will work, but it’s worth a try.

    Best,
    Ernest Marcinko

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


    #3008
    mmousfi
    mmousfi
    Participant

    Many thanks. Unfortunately, it did not work.

    #3009
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Do you still get results or not at all?

    What you exactly described is not possible. Unfortunately there is no way to determine which keyword belongs to which custom field. One of the custom fields hold the ‘practice, the other one the ‘city’. So one of the words must had to match one field, and the other one the other field, and each word must have at least one match. It sounds easy enough, however the current architecture of the plugin and the wordpress database makes it impossible.

    I’m currently writing the documentation to the next version, which is ready to get deployed. This version includes creation of fields related to custom fields: https://i.imgur.com/PYoWDZJ.png

    As you can see on the screenshot, you will be able to create radio boxes, dropdowns, checkboxes, range sliders that are connected to custom field values. In your case you will be able to make a dropdown field that contains the cities or practices (or 2 dropdowns with both).

    Best,
    Ernest Marcinko

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


    #3010
    mmousfi
    mmousfi
    Participant

    Hi Ernest

    I am ever so impressed with your readiness to modify and enhance your engine, I really appreciate this.

    I think this enhancement will be very helpful to myself and I guess others.

    I will look forward to hear from you and good luck with this.

    Marwan

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

You must be logged in to reply to this topic.