AND, OR search operators

This topic contains 12 replies, has 2 voices, and was last updated by gintautas gintautas 9 years, 5 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2583
    gintautas
    gintautas
    Participant

    Hi, how to set research logic operator by default? Now when I search in titles I get results with operator “OR”. When i type two words i need to get results with “AND” operator. In this case as shown in picture there should be no results. Thank you.

    #2584
    gintautas
    gintautas
    Participant

    Hi, how to set research logic operator by default? Now when I search in titles I get results with operator “OR”. When i type two words i need to get results with “AND” operator. In this case as shown in picture there should be no results. Thank you.

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

    Hi!

    Currently the search work only with an OR operator for separate keywords. However the 3.2 version is almost deployed to codecanyon, which contains this feature. I’m attaching a pre-release version here for you, so you can try this feature now.

    Steps for upgrade
    0. Make a backup copy of the current search folder just in case. It’s located in wp-content/plugins/ajax-search-pro/
    1. Deactivate, delete the old version through the plugin editor
    2. Install the one I attached here
    3. Open up the search setting and save them to refresh the database values and to re-create the stylesheets

    On the General option->Behaviour tab you should see now a new option dropdown called “Keyword Logic” where you can choose from ‘OR’ and ‘AND’.

    Best,
    Ernest Marcinko

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


    #2602
    gintautas
    gintautas
    Participant

    Hi! Thank you a lot. I did all what you wrote and played a lot, but AND option in behaviour settings doesn’t work in searches for Buddypress groups (titles) and other content types. Are you sure that new function is really working?
    Kind regards,
    Gintas

    #2603
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I didn’t know you are searching buddypress content. It’s not yet implemented there. It’s most likely getting done tomorrow. I will post a message here if we have a prototype to try.

    Best,
    Ernest Marcinko

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


    #2604
    gintautas
    gintautas
    Participant

    Thank you. I attached a screenshot of Relevanssi search plugin. Here is quite good idea when you choose AND operator as default and the search finds no matches, it will automatically do an OR search. Google does the same and shows under every result Missing: <striked out search term>. I use this plugin for search in groups titles. All these titles are addresses of buildings, so it’s important to get houses in results with exact street name and number. Now i get results from different streets with same number. Will be waiting for an update and thank you.
    Kind regards,
    Gintas

    #2605
    gintautas
    gintautas
    Participant

    Attachment:

    #2617
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I just finished an update, which contains the improvements for the buddypress search as well. On top of that there are 4 options now: ‘OR’, ‘AND’, ‘OR – exact words’, ‘AND – exact words’. This is a huge step forward and it’s not yet properly tested. The update instructions are the same as before.
    On top of that there are options now to enable/disable the search in public, private and hidden buddypress groups.

    Try out the ‘AND’ or the ‘AND – exact words’ option on the General option->Behaviour tab, one of them will suit your needs for sure.

    Best,
    Ernest Marcinko

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


    #2623
    gintautas
    gintautas
    Participant

    Hi!
    Thank you! Now looks better and more useful. But there is one thing. In previous versions when i typed any word having latin only characters i used to get results with non-latin characters too. I.e. if i typed “mazvydo” i got results with group title “Mažvydo” (letter “z” is with bird) In my language there are such symbols: ąčęėįšųūž. And many people types these letters in latin, but group names has these non latin letters except slugs. Can you solve this? Maybe 3.1 version searched in group titles and in url’s?
    Here you can download a video (better resolution) to see this problem: https://www.dropbox.com/s/xvqh17fnva3phla/nonlatin.mov?dl=0

    Also in behavior settings could be an optional box to thick: “If you choose AND and the search finds no matches, it will automatically do an OR search.”

    Kind regards,
    Gintas

    #2624
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are correct, that’s a problem. Fortunately it was only a typing mistake in the code. You only need to replace one file now to fix this. Go to wp-content/plugins/ajax-search-pro/includes/search_buddypress.class.php and open that file.

    Replace the file contents with this: http://pastebin.com/raw.php?i=aT97MJvP

    It should fix the issue immediately.

    Best,
    Ernest Marcinko

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


    #2625
    gintautas
    gintautas
    Participant

    After replacing search_buddypress.class.php plugin doesn’t give any results at all… Any ideas?

    #2626
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Try this one: http://pastebin.com/raw.php?i=Wt37DnL0

    The problem is that this way the database cannot distinguish the whole words from partial words. This will work, but will recognize partial words as well. I think you won’t even notice the difference, there is very little from the previous one.

    I was reading throuhg the documentation all day, but unfortunately, with mysql database there is no solution to exact word matches and to match special characters with no special characters at the same time 🙁

    Best,
    Ernest Marcinko

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


    #2627
    gintautas
    gintautas
    Participant

    Now it works 🙂 Thank you!

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

You must be logged in to reply to this topic.