• Resolved heberr

    (@heberr)


    So, if I use a typesense cloud server, I can get my searches to work. However as soon as I switch it to a self hosted typesense server the searches will not return any results. When I view the error log file. I get the following results:

    === START ==== ::Time:: 2023-10-19::20:42:15-UTC WP_Error::__set_state(array( ‘errors’ => array ( 404 => array ( 0 => ‘Not Found : Not Found’, ), ), ‘error_data’ => array ( ), ‘additional_data’ => array ( ), )) ===END===

    === START ==== ::Time:: 2023-10-19::20:42:20-UTC WP_Error::__set_state(array( ‘errors’ => array ( 404 => array ( 0 => ‘Not Found : Not Found’, ), ), ‘error_data’ => array ( ), ‘additional_data’ => array ( ), )) ===END===

    I’ve created this collection locally and on the cloud system.

    curl “https://localhost:8108/collections” \
    -X POST \
    -H “Content-Type: application/json” \
    -H “X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}” \
    -d ‘{
    “name”: “books”,
    “fields”: [
    {“name”: “.*”, “type”: “auto” }
    ]
    }’

    Still no results using the local typesense server. Any suggestions on what to look for?

    Thanks for any guidance you can provide.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    @heberr

    Yes a self hosted connection will work.
    If you only have the cluster on your local install then it won’t work on any live domains.
    Additionally the errors you are showing indicate that your self hosted typsense server is unreachable. Please make sure you are able to connect to your server.

    Thread Starter heberr

    (@heberr)

    Thanks for getting back with me. So here is my setup:

    I have a Ubuntu server running on Window 10 (WSL). A WordPress site and the typesense server on the Ubuntu server. I’ve configured the hosts file to resolve both server applications as docs.dharchives.org. Port 80 is for the Apache2 WordPress site and port 8108 is for the typesense server. Ill attached some screen shots on the results I am getting when I query the typesense server. When I type in the following typesense command “https://docs.dharchives.org:8108/health” in the web browser I get the following json results: ok true

    From what I can see the server is reachable. The plugin returns a successfully status when I index the posts. Also the search page does not indicate any errors, I just get no results when i enter a keyword. Is there a configuration that I may be missing with the plugin?

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi Heber,

    I am not quite sure, if you’re getting health ok then the requests should be fine. Without further details it’s pretty hard for me to debug this.

    But one thing that may be causing this is https – so by default Typesense is enabled via https, so can you please try that ?

    Thread Starter heberr

    (@heberr)

    So I decided to go with Type Sense Cloud for now. However every so often after I post a new post and try to re-index I get the following error:

    “Something has go wrong while bulk importing”

    === START ==== ::Time:: 2023-10-31::22:52:00-UTC WP_Error::__set_state(array( ‘errors’ => array ( ‘http_request_failed’ => array ( 0 => ‘cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received’, ), ), ‘error_data’ => array ( ), ‘additional_data’ => array ( ), )) ===END===

    Could this be due to the fact that the posts I am trying to index are large documents?

    Any suggestions on how to track down the issue?

    Thank You

    Heber

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi Heberr,

    How large is this document ? Maybe can you try using WP CLI to see if this solves the problem ? https://docs.wptypesense.com/wp-cli/

    Thread Starter heberr

    (@heberr)

    Not sure on how to tell the size of a post. So I uploaded the post from a word document using the post format & WordPress. These word documents are 300 KB to 900 KB in size. So listed below are the results of trying to index four of these posts. If I try to index all of them I get an error. If I try to index individual ones 2 are successfully indexed and the other 2 are not.

    sudo -u archives -i — wp typesense index post –ids=183,181,132,70

    PHP Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Error: cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received

    root@Developement:/var/www/docs_dharchives_org/wp-content/uploads# sudo -u archives -i — wp typesense index post –ids=183
    PHP Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Error: cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received

    root@Developement:/var/www/docs_dharchives_org/wp-content/uploads# sudo -u archives -i — wp typesense index post –ids=181
    PHP Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Success: post ID: 181 indexed successfully!!!

    root@Developement:/var/www/docs_dharchives_org/wp-content/uploads# sudo -u archives -i — wp typesense index post –ids=132
    PHP Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Success: post ID: 132 indexed successfully!!!

    root@Developement:/var/www/docs_dharchives_org/wp-content/uploads# sudo -u archives -i — wp typesense index post –ids=70
    PHP Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Warning: The magic method Vc_Manager::__wakeup() must have public visibility in /var/www/docs_dharchives_org/wp-content/plugins/js_composer/include/classes/core/class-vc-manager.php on line 203
    Error: cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received

    Is there a way to increase the operation time out value when indexing large documents?

    Thank you for all your help

    Heber

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    You can increase timeout by this

    function custom_timeout_extend( $time )
    {
        return 20;
    }
    
    add_filter( 'http_request_timeout', 'custom_timeout_extend' );

    Additionally WP CLI is a lot faster so for bulk indexing I would suggest you try https://docs.wptypesense.com/wp-cli/

    Thread Starter heberr

    (@heberr)

    Sorry, but I am new to TypeSense. Which file do I modify to add the function and filter in?

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @heberr,

    This isn’t a Typesense option rather its a wordpress option. So you can add it anywhere in you themes functions.php file.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Does a self hosted typesense server work with this plugin?’ is closed to new replies.