search engine configuration

Home Forums Product Support Forums Ajax Search Pro for WordPress Support search engine configuration

This topic contains 10 replies, has 2 voices, and was last updated by  Ernest Marcinko 3 years, 10 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2424

    Alberto Velilla
    Participant

    Hi:
    I am so happy with the plugin but I have a doubt about the search engine… I have a shop and I want the plugin only to find products. well…when I insert the word “freidora” for example.. the search engine show me all the products with this word in the tittle. But If I search “freidora de dos cubas” then the plugin show me things that not have any relation and not with the words in the tittle…
    I want to know how to configure the plugin to always show the first word of the tittle as the main woard. For example… “Freidora dos cubas” and show me as the firs resul “fregadreo bastidor dos cubas”. It has the “dos cubas” word but is not a “freidora” i want firs show all the freidoras and then other results…
    Here a screenshot http://awesomescreenshot.com/0403gza2db
    How could I do it?

    Thanks in advance

    #2425

    Ernest Marcinko
    Keymaster

    Hi!

    I think you should try the “exact matches” option on the general options panel – that is good if you have many products.

    When I get back to the office I will take a look at the source, to see if I can find a quick modification for your request.

    Best,
    Ernest Marcinko

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


    #2427

    Alberto Velilla
    Participant

    Thanks for the answer:
    I can´t use the exact matches because sometimes the people search “silla de madera” for example. This will show nothing because there is no product with tihs tittle but I want to show at least sillas and if it is possible, only show the results containing sillas in the tittle and madera in the excerpt or content…

    By the way… I can´t find the option exact matches in the general options….

    Thanks in advance!!

    #2450

    Alberto Velilla
    Participant

    Hi again:

    I have the same problems… I can´t configure the plugin to find what I want and to show only the relevant products…
    Is there any way to get more precise and relevant searchings?

    Thanks

    #2451

    Ernest Marcinko
    Keymaster

    Can you provide temporary admin and ftp access to your site? (you can do it by editing the first post in this thread)
    I can try to make some modifications on the search code based on your description. There is no configuration yet for your request, because it's too specific. I can however try to change a few lines and perhaps that will help.

    Best,
    Ernest Marcinko

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


    #2471

    Alberto Velilla
    Participant

    Hi:
    I provide the admin credentials to access to the site. But there are a pre-login and a login. The credentials are for the prelogin, for the login you have to enter this one
    USER: mainweb administrador
    PASS: mainweb2013

    If you can´t enter tell me because we have a lot of security systems and maybe my hosting must grant access to your IP.

    Thanks in advance

    #2487

    Ernest Marcinko
    Keymaster

    Hi!

    I could not enter with the credentials, perhaps my IP is restricted after all.

    But I think I might found a quick solution for your request.

    0. Turn off fulltext search if you are using it: https://i.imgur.com/1BcUDJ5.png

    1. Open up the plugins/ajax-search-pro/includes/search_content.class.php file and go to line 52, where you should see this:

                /*----------------------- Title query ---------------------------*/
                if ($options['set_intitle']) {
                    $words = $options['set_exactonly']==1?$s:$_si;
                    $parts[] = "(lower($wpdb->posts.post_title) REGEXP '$words')";
                    $relevance_parts[] = "(case when
                    (lower($wpdb->posts.post_title) REGEXP '$words')
                     then $searchData[titleweight] else 0 end)";
                    $relevance_parts[] = "(case when
                    (lower($wpdb->posts.post_title) REGEXP '$s')
                     then $searchData[etitleweight] else 0 end)";
                }
                /*---------------------------------------------------------------*/
    

    2. Replace that code with this:

                /*----------------------- Title query ---------------------------*/
                if ($options['set_intitle']) {
                    $words = $options['set_exactonly']==1?$s:$_si;
                    $parts[] = "(lower($wpdb->posts.post_title) REGEXP '$words')";
                    $relevance_parts[] = "(case when
                    (lower($wpdb->posts.post_title) REGEXP '$words')
                     then $searchData[titleweight] else 0 end)";
                    /*$relevance_parts[] = "(case when
                    (lower($wpdb->posts.post_title) REGEXP '$s')
                     then $searchData[etitleweight] else 0 end)"; */
                    
                    // The first word relevance is higher 
                    if (count($_s)>1) 
                      $relevance_parts[] = "(case when
                      (lower($wpdb->posts.post_title) REGEXP '".$_s[0]."')
                       then $searchData[etitleweight] else 0 end)";
                }
                /*---------------------------------------------------------------*/
    

    This modification will give the first search word higher priority, thus the order of the results will change.

    Best,
    Ernest Marcinko

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


    #2515

    Alberto Velilla
    Participant

    Hi: I used the code you provide and the fact is that it works the same or worse than before… Basically find things that the customer don´t want…

    By the way… I can´t find the option you mentioned (use fulltext search…etc)
    Other thing I want to know is if it is possible to exclude some words of the searches. For example if I introduce “maquinaria de hosteleria” it shows results containing the word “de” that has no relevance at all. As this options, the numbers has no relevance.

    Thanks in advance.
    Alberto

    #2516

    Alberto Velilla
    Participant

    I again:

    Go to http://auxihosteleria.es/
    and in the search box introduce the words freidora eléctrica… You will see the results shows the Freidora electrica in the third page… And the last results has no sense at all to be showed.

    If the search phrase is “silla de madera” then the firs resul is a “silla” but has no “madera” in any part of the chair… I thing you understand what I want…

    Thank you again and excuse me for the insistence

    #2531

    Alberto Velilla
    Participant

    Hi again:
    I need assist. Please if you say me your public IP I will grant access.

    Thank you in advance

    #2534

    Ernest Marcinko
    Keymaster

    Hi!

    Sorry, I didn't get notifications about your answers, something was wrong with this server. Here is my ip address: 159.253.104.31

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.