ioda logo

ioda fulltext engine

Interface documentation of the server program jodad

How to talk to the jodad server:

jodad offers functions to access the ioda fulltext engine by network communication. This is done by TCP socket communication.

The database name is obligatory the last parameter:
    jodad /path_to_database/database_name

You can declare the socket with the "socket" command line parameter:
    jodad -socket=1234 /path_to_database/database_name
where 1234 is an example of a socket number. If this parameter is not given, the socket #3359 is used by default.

If the server should offer write access, the parameter -rw has to be set, otherwise the server has read only access:
    jodad -rw -socket=2345 /path_to_database/database_name

jodad can handle multiple databases by one task through one socket:
    jodad -socket=4567 /apath/database_name1 /bpath/database_name2 ...
Of course you can start separate jodad's each with another socket.

Theres is one more optional parameter. It defines the maximum packet length:
    jodad -socket=5678 -rcvLen=1024 /path_to_database/database_name
If it is not given, the default value of 65536 bytes is used.

Function overview:
Parameters for the communication are given seperated by TABS (\t = character #9). This are the possible parameters:

close: -c database_name erase: -e database_name wordList id merge: -m target_database_name source_database_name open: -o database_name query: -q database_name query from until fileFilter maxHits sortOrder bitFilter query in UTF-8: -qu ... extended query: -x database_name query from until fileFilter bitFilter maxHits sortOrder ext.query in UTF-8: -xu ... insert: -s database_name wordList fileRef datestamp infobyte id view status: -v [database_name]

Please note that the full pathname of the database_name can be left out if the database name is unique under all the databases the requested server has opened. Otherwise a full qualified pathname is mandantory. For all calls except -o and except the source database in -m, the requested database has to be already opened from the server. This is done at execution time by parameter as described above or later at run time with -o.
The "database name" parameter has to be given to all function, except for "view status", where it is optional. The server shows the the status of all databases it manages if the name is missing.

Communication with the running server can be very easily testet with the Perl script "client.pl" from the "samples" subdirectory of the source package. It needs two leading parameters: IP adress and listening socket of the running server: client.pl network socket command parameters Example:
    client.pl localhost 3359 -q database_name "Hello World"
(parameters of the command lines are separated by spaces, the script wrappes them into the internally needed tab splitted format.)

Functions in detail:
-s database wordList [fileRef] [datestamp] [infobyte] [id]
Merge two databases into one or optimize a database:
-m target_database source_database

Merge can be used for the optimization of a database. For this purpose, it is sufficient, to create a copy (or softlink) of the source database config file as target config file. Now merge the existing database into the new (empty) one. The result is a perfect optimized copy of the source database, because now all equal words are (internally) pooled in one cluster. This will minimize disk seeks, therefore improves retrieving speed and saves disk space. Strongly recommended at least for for completed databases (like archives).

Retrieving functions:
-q   database query [from] [until] [fFilter] [maxHits] [sortOrder] [info]
-qu database query [from] [until] [fFilter] [maxHits] [sortOrder] [info]

With -q(u) joda retrieves all files/records with matched the given query. The letter "u" means that the query is formatted in UTF-8. Otherwise the query has to be in the same ISO-8859-XX format like the archived words. If "u" is used, the value "charsettable" in the databases config file has to be set to one of the "8859_X.iso translation tables belonging to the joda distribution.

The first two lines of jodas respone are always:

The format of the hits depends on the value of "fileref" in the database configuration file. Working with filenames (a *.ref file exists), joda answers:

Without file ref joda will answer per hit:

Important: " · " chars shown above are TABS in reality, this means \t (character #9)!

Query examples:


-x   database query [from] [until] [fFilter] [bFilter] [maxHits] [sortOrder]
-xu database query [from] [until] [fFilter] [bFilter] [maxHits] [sortOrder]

The difference between queries using "-q" and those using "-x" is only the handling of the bit filter. While it is in -q a single value which has to match exactly, its use in -x is more sophisticated.

[lydon documentation starts here (to be written)]

SourceForge.net Logo