Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › AND, OR search operators
- This topic has 12 replies, 2 voices, and was last updated 11 years, 8 months ago by
gintautas.
-
AuthorPosts
-
October 4, 2014 at 11:20 pm #2583
gintautas
ParticipantHi, 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.
October 4, 2014 at 11:20 pm #2584gintautas
ParticipantHi, 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.
October 6, 2014 at 6:13 pm #2594Ernest Marcinko
KeymasterHi!
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 stylesheetsOn the General option->Behaviour tab you should see now a new option dropdown called “Keyword Logic” where you can choose from ‘OR’ and ‘AND’.
October 6, 2014 at 9:51 pm #2602gintautas
ParticipantHi! 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,
GintasOctober 6, 2014 at 9:59 pm #2603Ernest Marcinko
KeymasterI 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.
October 6, 2014 at 11:12 pm #2604gintautas
ParticipantThank 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,
GintasOctober 6, 2014 at 11:47 pm #2605gintautas
ParticipantAttachment:
October 7, 2014 at 3:51 pm #2617Ernest Marcinko
KeymasterHi!
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.
October 7, 2014 at 5:37 pm #2623gintautas
ParticipantHi!
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=0Also 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,
GintasOctober 7, 2014 at 6:01 pm #2624Ernest Marcinko
KeymasterYou 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.
October 7, 2014 at 6:19 pm #2625gintautas
ParticipantAfter replacing search_buddypress.class.php plugin doesn’t give any results at all… Any ideas?
October 7, 2014 at 6:29 pm #2626Ernest Marcinko
KeymasterTry 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 🙁
October 7, 2014 at 6:53 pm #2627gintautas
ParticipantNow it works 🙂 Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.