Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Not all keywords shows as results
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 4 months ago.
- AuthorPosts
- January 12, 2021 at 2:08 pm #31078
Hi! I get results on example keyword “0,189” but not keyword “U-värde” thats in the same document? How do I fix that? I updated your login credentials. Please note that the webpage is live.
Attachments:
You must be logged in to view attached files.January 12, 2021 at 2:26 pm #31085Hi,
I just tried searching “0,189”, but I get the correct results, at least it looks like it: https://i.imgur.com/BXp62fR.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 12, 2021 at 2:27 pm #31086Yes 0.189 works but not U-värde thats just above in the data-table.
January 12, 2021 at 2:37 pm #31087Hard to tell, it may not have been indexed properly, or maybe it is encoded in some way – or there is simply something with the configuration. Can you please check the back-end details? I cannot log-in with them.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 12, 2021 at 2:47 pm #31088Updated with same password and sucessfully logged in. Please try again.
January 13, 2021 at 12:54 pm #31107Thank you! I looked up the configuration, and made a few changes, hopefully in your favor. The problem here I believe is, that the word “U-värde” was not recognized by either of the PDF parsers, and probably some other unwanted strings or boundaries were indexed. While the search tries to resolve these as much as possible, it looks like that some content is still not properly indexed.
There are a few things we can do about it to make it better. First, I applied the following logic configuration, and limit configuration.
I also added this custom code to the functions.php file in your child theme directory.
add_filter('asp_search_phrase_before_cleaning', 'asp_replace_characters', 10, 1); add_filter('asp_query_args', 'asp_replace_characters', 10, 1); function asp_replace_characters( $s ) { $characters = "',._-?!"; // Type characters one after another $replace_with = ' '; // Replace them with this (space by default) if ( is_array($s) ) { if ( isset($s['s']) && !$s['_ajax_search'] ) $s['s'] = str_replace(str_split($characters), $replace_with, $s['s']); } else { $s = str_replace(str_split($characters), $replace_with, $s); } return $s; }
This code will remove “-” and other special characters from the search phrase. This way, when entering “U-värde” the plugin will search “U värde”. With the “AND” logic, it will look for partial matches for both “U” and “värde” keywords – which are apparently present in the index for those files.
Best,
I had to increase the limit as well, because other results also appeared for this new search logic, and so more of them are displayed – otherwise they might appear as “missing”.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 13, 2021 at 1:00 pm #31108Thank you!! 😀
This case is now solved!! 🙂January 13, 2021 at 1:39 pm #31110You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.