Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search issues with punctuation, word position in sentence
This topic contains 6 replies, has 2 voices, and was last updated by visyoual 5 years, 3 months ago.
- AuthorPosts
- January 24, 2018 at 9:02 pm #16467
I have a shortcode search on this page:
https://seams.org/seams-power-search/It searches mainly users / user meta
There seems to be issues with search terms at the beginning of sentences.
There also seems to be issues with punctuation like apostrophes; ex: womens women’s womenAdditionally, is there any way to bind words together so that a search for one term would yield a result of something similar?
For instance, the previous example… could I bind women, women’s, womens so that all of the act like a single term?I know this may be a bit abstract, please let me know if any of this doesnt make sense.
January 25, 2018 at 10:57 am #16473Hi!
Thank you for the details! I have tried to log-in to check the configuration, but I was not able to, I’m getting an ‘Invalid username’ issue.
There seems to be issues with search terms at the beginning of sentences
Can you please be more specific about this one?Binding words
Best,
Well, with a custom filter function there might be a possibility to do so, but it depends on how the information is stored in the database. There is no language recognition within the plugin, that is way beyond it’s scope, but manually replacing search phrases could be possible. So for example, if the code detects a word from the defined phrase, it replaces it with another one defined. That could be doable. Let me know if that is something you are interested in.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 30, 2018 at 3:36 pm #16538Im not sure what happened with the account credentials.
Lets try
ajaxadmin
pjxoxBidN8JJV6#3%VJ^[email protected]The search issue is the critical problem with regards to the punctuation and the term position within the sentence.
Binding the search terms would certainly be nice to have but is a bit less important than the search issue above. Would it be very difficult to implement the term binding?
Thank you again for your help.
January 30, 2018 at 3:39 pm #16539You cannot access this content.January 30, 2018 at 3:42 pm #16540You cannot access this content.January 30, 2018 at 5:27 pm #16548Thank you, I can log-in now and see your configuration.
However, I still don’t understand the issue with the ‘search terms at the beginning of sentences’. Can you please describe this, or perhaps give me a few examples. I have tried search keywords that are at the beginning of sentences, but I’m seeing those results as well.
Apostrophes and special characters
The problem arises from the fact that there are multiple apostrophe characters used. For example ‘ is not the same as ’. When database is instructed to look for the words entered, it cannot make a difference between one apostrophe and another. For the database, those are just two separate entities, like letters ‘a’ and ‘b’.The two possible solutions in this case are:
1. Replace the apostrophe (and any other undesired characters) from the input phrase with an empty space.
Solution: Knowledge base – Replace or remove characters from search phrase
2. ..or replace whole words with different words within the input. (for example replace women’s with women only)
Solution: Knowledge base – Replace search keywords (whole words)
Both of these require a custom code, but it should not be too difficult, I tried to add as many explanatory lines to these knowledge base articles as possible. Let me know if you have any questions though.I personally prefer solution 1, as it’s much simpler, but then solution 2 offers replacements for whole words with a different word, so in that case adding lines like:
..to the $replace array, will replace both versions of the input with the word ‘women’, which will then yield results.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 30, 2018 at 5:29 pm #16549Thank you for the quick reply. I certainly appreciate it! I will give it a shot.
Regards,
– J - AuthorPosts
You must be logged in to reply to this topic.