Elastic search

From TempusServa wiki
Revision as of 20:59, 28 November 2017 by old>Admin (→‎Optional OCR components (BETA))
Jump to navigation Jump to search

Fulltext search on Tomcat/Linux installations

In order to index records and files you will need to complete these steps

  1. Install standalone Elastic search server
  2. Install and configure Tempus Serva file indexing
  3. Configure the Tempus Serva installation

Install Elastic search

Java 8 / Elastic search 6

This is the recommended version but requires Java 8.

Follow this guide:

 https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html

Java 7 / Elastic search 1.7

This version is an alternate version.

Install and unpack files

 sudo wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.tar.gz
 tar -xvf elasticsearch-1.7.6.tar.gz
 sudo rm elasticsearch-1.7.6.tar.gz

Run as a daemon

 elasticsearch-1.7.6/bin/elasticsearch -d

Test that the service is running

 curl 'http://localhost:9200/?pretty'

Install TS indexing service

Install war file

 cd /usr/share/tomcat6/webapps/
 sudo wget https://www.tempusserva.dk/install/tsFileIndexingService.war

A couple of seconds later you can configure he data connection and paths for OCR librarys

 sudo nano /usr/share/tomcat6/conf/Catalina/localhost/tsFileIndexingService.xml

Restart server after changes

 tstomcatrestart


Enable and test indexing in Tempus Serva

Set the following configurations to true

  • fulltextIndexData
  • fulltextIndexFile

Also add port 8080 to the following URL

  • fulltextFileHandlerURL

Update any record in the TS installation

Tjeck the index is created and that there is a mapping for the solution

 curl 'http://localhost:9200/tempusserva/?pretty'

Next validate that records are found when searched for (replace * with a valid string)

 curl 'http://localhost:9200/tempusserva/_search?pretty&q=*'

Finally validate that the Tempus Serva wrapper also works

 http://ec2-176-34-157-126.eu-west-1.compute.amazonaws.com/TempusServa/fulltextsearch?subtype=4&term=*

Trouble shooting

In doubt if the indexer has been executed ?

 <server>/tsFileIndexingService/execute


Optional OCR components (BETA)

2-3 libraries must be installed (ghostscript is probably allready installed)

 sudo yum install tesseract-ocr
 sudo yum install ImageMagick
 sudo yum install ghostscript

Afterwards change the configurations in the file indexer

 sudo nano /usr/share/tomcat6/conf/Catalina/localhost/tsFileIndexing.xml

The values should be