Not all keywords shows as results

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 Ernest Marcinko 3 years, 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31078
    emwi36
    emwi36
    Participant

    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.
    #31085
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #31086
    emwi36
    emwi36
    Participant

    Yes 0.189 works but not U-värde thats just above in the data-table.

    #31087
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hard 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 :)


    #31088
    emwi36
    emwi36
    Participant

    Updated with same password and sucessfully logged in. Please try again.

    #31107
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank 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”.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #31108
    emwi36
    emwi36
    Participant

    Thank you!! 😀
    This case is now solved!! 🙂

    #31110
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.