[Xapian-discuss] patch proposal: omindex library or daemon
Liam
xapian at networkimprov.net
Tue Oct 18 06:25:00 BST 2011
Olly (looking at commit logs, I think this is your dept :-)
For apps which re/index files frequently and need format conversion, I'd
like to propose a patch for one of...
Omindex library (thread safe):
Omindex::init(options) // struct Omindex::options { ... }
initialize mime_map, store default options
session = new Omindex::Session(db_pathname)
user threads use different sessions
session.index_files(list, options) // list & return value are vector of {
char * url, * file_path, * file_ext }
perform a transaction for all files in list; create & return skip_list
session.index_directory(url, dir_name, options)
perform a transaction for all files in a directory tree; return
skip_list
main() moves to omindex_main.cc
process command line, call Omindex::init(), proceed normally
SWIG & Node.js bindings
Omindex daemon mode:
The initial directory pass is optional.
Listen on a domain socket; for each connection, start a thread with a
WritableDatabase and read JSON-formatted messages.
Perform a transaction for each message.
Respond with a skipped list.
The library is more flexible, I think... Would you accept a patch for this?
More information about the Xapian-discuss
mailing list