Curl (optional)

Smartsite 7.9 - Smartsite 7.9

Purpose

Curl is a command line tool to transfer data with URLs. It can for example be used:

  • to send a request to Elastic Search to list the cluster health.
  • to send a document to the Tika server and get a response containing the document metadata.

Installation is optional.

Version

  • Curl v7.83.1.

Media

The installation media includes folder Enterprise Search\12.1\Curl, containing:

  • curl-7.83.1-win32-mingw.zip
  • curl-7.83.1-win64-mingw.zip

Installation

Place the curl executable.

  1. For 64 bit unpack curl-7.83.1-win64-mingw.zip in a temporary folder, and locate bin\curl.exe.
  2. Copy curl.exe to a folder that is in the list of folders as specified by the PATH environment variable.

Usage examples

Run curl in a command box, not necessarily as administrator.

Tika examples. Adjust the document name, host name and port as appropriate.

  • Get the Elastic Search cluster health: curl --ssl-no-revoke --user elastic:<strong-password> --get https://server1.example.company.nl:9202/_cluster/health?pretty=true
  • List the Elastic Search indices: modify the above to: _cat/indices
  • Obtain document metadata: curl --upload-file Test.docx http://tikaserver:9203/meta
  • Obtain the document text: curl --upload-file Test.docx http://tikaserver:9203/tika
  • Obtain the document language:
    • Capture representative  text: curl --upload-file Test.docx http://tikaserver:9203/tika > Test.txt.
    • Use the text to detect a language: curl --upload-file Test.txt http://tikaserver:9203/language/stream.

Secure (https) access will fail if curl cannot verify the certificate. This can be solved with some effort. Alternatively supply the --insecure parameter to allow insecure access, and/or supply --ssl-no-revoke, and supply credentials if applicable.