Search not working completely

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search not working completely

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28359
    Jim70
    Jim70
    Participant

    Hi,

    Our search that we implemented is not searching all the pdfs (or is searching pdfs incompletely). We need help to fix this.

    We have uploaded a few custom pdfs, which are quite small in size (there are some large ones too).

    For example if we search for ‘MS1850’, the the custom pdf https://resources.locksandsafes.com/wp-content/uploads/Adams-Rite-Deadlock-Product-Selection-Guide.pdf
    is displayed in the search results (as ‘Adams Rite Deadlock Product Selection Guide’)

    But if we search for the term ‘MRS-STS’ or ‘MRS-XLS’ or ‘STS’ then the custom pdf
    https://resources.locksandsafes.com/wp-content/uploads/PDQ-Smart-Locks-Final.pdf
    (or in fact no document) shows up.
    The pdf shows up for some other keywords. For example for ‘STP’

    My question was how can we increase the efficiency of our searches.

    We have enabled two layer search.
    We have enabled page search along with documentation search.

    Any help would be greatly appreciated.

    Also, please add cc on reply email to [email protected]

    Thanks,
    Shivam

    #28364
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Shivam,

    Thank you very much for the details.

    I may have found the problem. Some of the PDF files contain double spaces after each word, and random spaces within the words, that causing the high number of keywords, mostly gibberish. I’m not sure if this is something to do with the extraction script, or the PDFs or something else. I have tested a potential solution on our local servers via uploading the problematic files, and got much better results.

    1. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_indexing_string_pre_process', 'asp_custom_double_char_detection', 10, 1);
    function asp_custom_double_char_detection($str) {
    	if ( substr_count($str, ' ') > 100 ) {
    		$str = str_replace('  ', '||||', $str);
    		$str = str_replace(' ', '', $str);
    		$str = str_replace('||||', ' ', $str);
    	}
    	return $str;
    }

    This code will try detecting high number of duplicate whitespaces, and tries to correct the text.

    2. Make sure to re-create the index, so the code has the effect. The keywords count should reduce significantly with much more relevant keywords.

    3. Optional, but I strongly recommend this keyword logic for your case: https://i.imgur.com/r47o5Ib.png
    Because there are a lot of keywords to get results from, this should improve accuracy greatly.

    Best,
    Ernest Marcinko

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


    #28598
    Jim70
    Jim70
    Participant

    Hi Ernest

    Thanks for this information. I added the code and tried to create a new index table. Unfortunately i get an error that ajax search pro has problems in connecting to the database. Please check whether the credentials in wp-config are correct.

    I did not understand, since the whole site is working fine. What could be the issue?

    Thanks,
    Shivam

    #28624
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Shivam,

    I checked, and run the indexing for 2 hours. The server gets exhausted from indexing a few longer documents consecutively (15 000+ words per document). Looks like it is able to finish them, but it takes a lot of time, and sometimes the server kills the process or restarts it.
    The plugin tries to slow down the indexing accordingly, but after a few failures it does not continue, to not trigger more errors.

    I was able to get to around 83% indexed documents. All you need to do if the error appears, is to simply refresh the page, wait a bit, and then hit the “Continue existing index” button. It should not happen often though. Since there are a lot of documents, this will take some time, but should finish eventually without any issues.

    Best,
    Ernest Marcinko

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


    #28744
    Jim70
    Jim70
    Participant

    Thanks Earnest,

    That worked well. Search is working much better now.

    Regards,
    Shivam

    #28747
    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 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.