Fiexes in flask-script for rebuilding indexes. Python2.6 compatibility. Make changes in schema for better integration with Moin.

https://bitbucket.org/marchael/moin-2.0/changeset/98cbec45cffb

--

This day I'm working on inex update script.

It iterating over all backend items and if finds what latest revision modify time in whoosh index is older than modify time in backend then script updates all revisions of that document.

Note:

MoinMoin backend using os.path.getmtime() as format for storing last modidy time. But whoosh using datetime.datetime for that. So I'll convert 'getmtime() to datetime() using datetime.date.fromtimestamp()

--

I'm feeling what something wrong with whoosh.filedb.multiproc.MultiSegmentWriter.

For adding documents to index I'm using code like:

# all_rev_index - open index, procs - processes count, limitdb - limit in mbytes

with MultiSegmentWriter(all_rev_index, procs, limitmb) as all_rev_writer:
    all_rev_writer.add_document(something)

Full code here: https://bitbucket.org/marchael/moin-2.0/src/98cbec45cffb/MoinMoin/script/maint/build_indexes.py#cl-47

but I run this code once, twice, etc. index files still have size 36K

ls -lh wiki/index/
итого 72K
-rw-r--r-- 1 marchael marchael 36K Июн 19 18:18 _all_revisions_index_7.toc
-rwxr-xr-x 1 marchael marchael   0 Июн 19 18:16 all_revisions_index_READLOCK
-rwxr-xr-x 1 marchael marchael   0 Июн 19 18:16 all_revisions_index_WRITELOCK
-rw-r--r-- 1 marchael marchael 36K Июн 19 18:18 _latest_revisions_index_7.toc
-rwxr-xr-x 1 marchael marchael   0 Июн 19 18:16 latest_revisions_index_READLOCK
-rwxr-xr-x 1 marchael marchael   0 Июн 19 18:16 latest_revisions_index_WRITELOCK

MoinMoin: MichaelMayorov/GSoC2011Diary/2011-06-19 (last edited 2011-06-23 05:16:57 by MichaelMayorov)