Ahax Pro search

This topic contains 17 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #23549
    Gameware
    Gameware
    Participant

    Hi, I would like to know if I can get the following search criteria to work using the Index Table Engine. (I currently have 20,000 products on my site) At the moment I am only having partial success.

    For example I am searching for a product named Madden NFL 19 – PlayStation 4 (This is exactly how it appears on my site.)

    (In Ajax Playstation 4 is set as a keyword. PS4 is set as a synonym.)

    The below various search criteria does not work. These will be the most popular searches by my customers. Is there a way to get them to work? These searches work on sites such as Amazon.com, Bestbuy.com, and Gamestop.com. I need the searches to be fast.

    Playstation 4 Madden 19
    Madden 19 Playstation 4
    PS4 Madden 19
    Madden 19 PS4

    These searches work:

    Madden nfl 19 – playstation 4 (finds specific version)
    Madden nfl 19 (finds all versions)
    Madden 19 (finds all versions)

    Thank you.

    #23557
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for the details, I was able to find the issue and probably fix it as well.

    So due to the relatively large number of keywords, the plugin tries to assume the “pool size”, which is used when matching overlapping sets of results. When the pool size is too small, then potentially some of the results might be missed from the final list.
    I have adjusted the pool sizes manually according to the keywords count, it should give you much better results now: https://i.imgur.com/o90UAgT.png

    I hope this helps!

    Best,
    Ernest Marcinko

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


    #23570
    Gameware
    Gameware
    Participant

    Hi,

    It’s working better but there’s still no results for the below searches. These would be the most common searches. I have PS4 set as a synonym for Playstation 4 so I am not sure why it’s not working.

    PS4 Madden 19
    Madden 19 PS4

    #23581
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I see what the problem is then. Synonyms cannot be set for mutliple word keywords only single words. So “Playstation 4” will have no effect whatsoever, since it is composed from two separate words. I wonder why it allowed you entering multiple keywords into the synonyms input (I guess with copy/paste?), I will check that for a later release.

    The most optimal solution would be for this to use the additional keywords inputs, however I guess you have a lot of records, so that could be problematic. Another possibility, is to use the custom code from this knowledge base.
    You could use these keywords in the $replace variable like:

    $replace = array(
        'ps4' => 'playstation 4',
        'ps2' => 'playstation 2',
        'ps1, psone, ps' => 'playstation 1' 
    );
    Best,
    Ernest Marcinko

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


    #23594
    Gameware
    Gameware
    Participant

    I have playstation 4 set as a key word. Not set as a synonym. Can the key word be multiple words? All the keywords I am using are in the title of each product. For example, “Madden NFL 19 – PlayStation 4”. I have ps4, one word, set as the synonym for key word playstation 4. When i search playstation 4 madden 19 it works perfectly. However, when I search ps4 madden 19 it does not work.

    Can I globally import additional keywords? How do I get to the meta box on post editor screen?

    If it comes to custom code are you able to do that for me? I am not a developer and don’t fee comfortable doing custom coding.

    Thank you.

    #23600
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Unfortunately synonyms are one single word phrases, both the keyword and the synonym must be a single word (there are many reasons for that, I would rather not go into details why).

    The only way is to use that custom code. If you want, I can help you implementing that, if you have a list of the needed keywords. Just add temporary FTP details, so I can make the changes within the child theme functions file.

    Best,
    Ernest Marcinko

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


    #23604
    Gameware
    Gameware
    Participant

    Will you do all 3 search themes the same please? Thank you very much.

    ‘ps4’ => ‘playstation 4’,
    ‘ps3’ => ‘playstation 3’,
    ‘ps2’ => ‘playstation 2’,
    ‘ps1, psone, ps one, ps, psx’ => ‘playstation 1’
    ‘snes’ => ‘super nintendo’,
    ‘n64’ => ‘nintendo 64’,
    ‘wiiu’ => ‘nintendo wii u’,
    ‘gc’ => ‘nintendo gamecube’,
    ‘gameboy, gb’ => ‘game boy’,
    ‘gameboy, gb, gbc’ => ‘game boy color’,
    ‘gameboy, gba’ => ‘game boy advance’,
    ‘xb1,’ => ‘xbox one’,

    #23609
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Can you please add temporary FTP details? Otherwise I cannot change the files.

    Best,
    Ernest Marcinko

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


    #23619
    Gameware
    Gameware
    Participant
    You cannot access this content.
    #23620
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you!

    I have managed to make the change, please check it.

    For future reference, this is the code I added:

    // AJAX SEARCH PRO
    add_filter( 'asp_query_args', 'asp_replace_search_keywords', 10, 2 );
    function asp_replace_search_keywords( $args, $id ) {
      /**
       * Add as many words as you want. On the left side place the
       * word or words separated by comma to replace.
       * To the right side, place the single word to replace it with.
       */
      $replace = array(
            "ps4" => "playstation 4",
            "ps3" => "playstation 3",
            "ps2" => "playstation 2",
            "ps1, psone, ps one, ps, psx" => "playstation 1",
            "snes" => "super nintendo",
            "n64" => "nintendo 64",
            "wiiu" => "nintendo wii u",
            "gc" => "nintendo gamecube",
            "gameboy, gb" => "game boy",
            "gameboy, gb, gbc" => "game boy color",
            "gameboy, gba" => "game boy advance",
            "xb1," => "xbox one"
      );
      // ----------------------------------------
      // Do not change anything below this line
      // ----------------------------------------
      foreach ( $replace as $k => $w ) {
        $kr = explode(',', $k);
        foreach ($kr as $krk => &$krv) {
          $krv = trim($krv);
          if ( $krv == '' ) {
            unset($kr[$krk]);
          } else {
            $krv = '/\b' . $krv . '\b/u';
          }
        }
        if ( count($krv) > 0 ) {
          $args['s'] = preg_replace($kr, $w, strtolower($args['s']));
        }
      }
      return $args;
    }
    Best,
    Ernest Marcinko

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


    #23622
    Gameware
    Gameware
    Participant

    This is working perfectly. Thank you.

    I have UPC’s assigned to each product using custom attributes. When I search for UPC 014633736977 the drop down results is showing 014633736977. When I click on drop down result it takes me to the 2 products that are assigned to this UPC.(Used and new version of product) Is there a way to make it show the product title for drop down result instead of UPC? This example UPC is for Madden NFL 19 – PlayStation 4.

    Is there a way to speed up search results?

    #23624
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Sure, that is possible as well. So, instad of selecting these taxonomy terms to be returned as results, you should instead select them in the index table options panel:
    – Step 1, deselect them under the search settings: https://i.imgur.com/vBs9sa2.png
    – Step 2, select them under the index table options: https://i.imgur.com/9Ry4PHN.png

    For better performance, I recommend checking these tips from the documentation.
    Ultimately the search performance corresponds with the server response time, as well as the number and quality of the plugins installed etc.. Those tips may give you the best possible response time with your configuration.

    Best,
    Ernest Marcinko

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


    #23628
    Gameware
    Gameware
    Participant

    I must have did something wrong. I thought I followed your steps but now the search is not working at all. There must be something I didn’t do.

    #23632
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The index table is not fully generated. Make sure to click on the ‘Create new index’ button and wait until it finishes: https://i.imgur.com/FPK4aqJ.png
    That will solve the problem.

    Best,
    Ernest Marcinko

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


    #23636
    Gameware
    Gameware
    Participant

    Hi, I did a fully generated index table and it is still not working.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.