Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Exact match
This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 12 months ago.
- AuthorPosts
- September 28, 2017 at 6:17 pm #14934
Hi,
try to write “Milano” and then try to search “Milano Marittima”. They are two different cities but when you write Milano Marittima the drivers of Milano appear too.
Is there a method to let appear only the Milano Marittima drivers?
ThanksSeptember 29, 2017 at 8:43 am #14937Hi,
Probably the easiest and fastest solution would be to simply turn on Exact matches on the General Options -> Logics & Behavior panel: https://i.imgur.com/e64LMsm.png
I hope this helps.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 29, 2017 at 9:10 am #14942Ok, thanks this helped a lot! But if I write “milano” the last result is the driver of “milano marittima” . Do you know a method to exclude him from the milano search?
Thank you very much and have a nice day
FrancescoSeptember 29, 2017 at 1:01 pm #14945Hi Francesco,
Well, there is no configuration to do that, as ‘milano’ will always match ‘milano marittima’. But, there is a way to do that with a custom code. I’ve made a small code snippet for you, that will change the search query arguments and exclude post 16070 aka ‘Transporter Sas’ when the phrase is ‘milano’.
Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
IMPORTANT: Before making any direct changes in your site files, please make sure you have a back-up of everything. To edit the files, I highly recommend using an (s)FTP client, instead of the internal file editor in WordPress – as any tiny mistake there can potentially lead to a site error.
Let me know if you need help with this 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 29, 2017 at 2:22 pm #14954Thank you very much!!! Fantastic!
September 29, 2017 at 2:23 pm #14955You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 5, 2017 at 10:13 pm #15028Hi, in italian works great! Is there a method to exclude the phrase beside the uppercase? I mean, I want to exclude “milano” but the script has to exclude also “Milano” and “MILANO”. Just tell if is it possible in a simple way or if I need to add a line for every possibility.
Thanks
Francesco-
This reply was modified 5 years, 12 months ago by
splash94.
October 6, 2017 at 9:16 am #15031Hi Francesco,
I totally forgot about that possiblity. There is actually a very simple way, no need to add the variations one by one. I have made a change to the code, so now the phrases are converted to lower case before comparison:
This should work, no matter which letters are lower-upper case.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 6, 2017 at 9:24 am #15033That’s fantastic! Already tested and it works good!
I’ve rated you 5 stars on codecanyon, fantastic support.
Thanks a lot
FrancescoOctober 6, 2017 at 9:25 am #15034You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
-
This reply was modified 5 years, 12 months ago by
- AuthorPosts
You must be logged in to reply to this topic.