Search keyword not working properly

Tagged:
  • hsurekar
    Participant
    2 years, 3 months ago #29722

    Hi
    I have created new index and start indexing but i am getting frequently error while doing indexing.
    I have skipped so many posts but still i am getting below error.
    An error or timeout occured.
    Error code: parsererror
    Error message: SyntaxError: Unexpected token P in JSON at position 0

    wpsolr
    Keymaster
    2 years, 3 months ago #29723

    You can try with Elasticsearch, or Algolia. they could be less prone to this error than Solr.
    Or try to fix your posts. For instance, if you import your posts from a file, the file could be corrupted with bad characters during the export.

    hsurekar
    Participant
    2 years, 3 months ago #29724

    Thanks for your quick reply.
    but is there a way to skip these articles without breaking indexing process?
    Thanks

    wpsolr
    Keymaster
    2 years, 3 months ago #29725

    You can try commenting out line 878 of file wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractindexclient.php:

    try {
    
    	$res_final = $this->send_posts_or_attachments_to_solr_index( $documents );
    
    } catch ( \Exception $e ) {
    
    	if ( $is_debug_indexing ) {
    		// Echo debug text now, else it will be hidden by the exception
    		echo $debug_text;
    	}
    
    	// Continue
    	// throw $e; <== THIS LINE COMMENTED !!!!
    }
    • This reply was modified 2 years, 3 months ago by wpsolr.
    hsurekar
    Participant
    2 years, 3 months ago #29727

    Thanks for your reply.
    I tried above suggested solution but still getting same errors frequently.
    Could you please help me out of this issue.
    Thanks

    wpsolr
    Keymaster
    2 years, 3 months ago #29728

    By commenting the code above, you should be able to continue indexing while getting errors.

    What happens exactly?

    hsurekar
    Participant
    2 years, 3 months ago #29730

    image
    Attached screenshot of commented code.
    output error
    Thanks

    hsurekar
    Participant
    2 years, 3 months ago #29731

    Image view of
    Image view of

    hsurekar
    Participant
    2 years, 3 months ago #29732

    Image view of

    Image view of

    wpsolr
    Keymaster
    2 years, 3 months ago #29734

    As you checked “Debug infos during indexing”, you can see the errors, but this should not prevent the indexing to continue till the end (after the small code customisation described above).

    Can you try again without the “Debug infos during indexing” ?

    hsurekar
    Participant
    2 years, 3 months ago #29735

    Image view of
    After uncheck debug it’s giving error

    wpsolr
    Keymaster
    2 years, 3 months ago #29737

    This is an error triggered by the previous code commented, as $res_final is no more defined.

    Please add the following initialisation, after your commented line 878:

    // throw $e; <== THIS LINE COMMENTED !!!!
    $res_final = 0;
    hsurekar
    Participant
    2 years, 3 months ago #29742

    It is working now thanks for your help.
    But one more question.
    while we are creating new post from admin side at that time it’s not indexing automatically. we need to indexing manually instead of cron. So could you please let me know how can i make it automate index instead of manually?

    Thanks

    wpsolr
    Keymaster
    2 years, 3 months ago #29745

    Automatic indexing is the default with WPSOLR. Unless you selected “Do no index in real-time” option on screen 2.2

    hsurekar
    Participant
    2 years, 3 months ago #29879

    Hi

    I have getting below error while doing indexing.

    An error occured:

    Error on line 161 of file /nas/content/live/tabbgroup/wp-content/plugins/wpsolr-pro/wpsolr/core/vendor/solarium/solarium/src/Core/Client/Adapter/Http.php: file_get_contents(https://aws-virginia-solr4-10.opensolr.com:80/solr/tabbforum/update?omitHeader=false&wt=json&json.nl=flat): failed to open stream: HTTP request failed!

    could you please let me know how to fix this error?

    Thanks

Viewing 15 posts - 31 through 45 (of 114 total)

You must be logged in to reply to this topic.