Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Not all keywords shows as results
- This topic has 7 replies, 2 voices, and was last updated 5 years, 4 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 12, 2021 at 2:08 pm #31078
emwi36
ParticipantHi! 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.
January 12, 2021 at 2:26 pm #31085Ernest Marcinko
KeymasterHi,
I just tried searching “0,189”, but I get the correct results, at least it looks like it: https://i.imgur.com/BXp62fR.png
January 12, 2021 at 2:27 pm #31086emwi36
ParticipantYes 0.189 works but not U-värde thats just above in the data-table.
January 12, 2021 at 2:37 pm #31087Ernest Marcinko
KeymasterHard 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.
January 12, 2021 at 2:47 pm #31088emwi36
ParticipantUpdated with same password and sucessfully logged in. Please try again.
January 13, 2021 at 12:54 pm #31107Ernest Marcinko
KeymasterThank 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.
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”.January 13, 2021 at 1:00 pm #31108emwi36
ParticipantThank you!! 😀
This case is now solved!! 🙂January 13, 2021 at 1:39 pm #31110Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.