[jsword-devel] Fwd: [jsword] JS-98: IndexManager.needsReindexing(Book book); as the API to detect if per-book index need to be recreated (#74)

DM Smith dmsmith at crosswire.org
Sun Mar 30 13:27:18 MST 2014


Sijo asked this via github. Thought it'd be good to get feedback here.

-- DM

Begin forwarded message:

> From: Sijo Cherian <notifications at github.com>
> Subject: [jsword] JS-98: IndexManager.needsReindexing(Book book); as the API to detect if per-book index need to be recreated (#74)
> Date: March 29, 2014 at 7:31:52 PM EDT
> To: crosswire/jsword <jsword at noreply.github.com>
> Reply-To: crosswire/jsword <reply+i-30455246-2897689b705296a200fa088d2af792bed6bc6a4a-1645068 at reply.github.com>
> 
> Following is the upgrade criteria implemented by comparing IndexMetadata from prop files: needsReindexing returns true, if Latest.Index.Version.xxx > Installed.Index.Version.xxx OR if {index folder} is not found at all.
> 
> For now uses two prop file: 1. IndexMetadata.prop file (can be updated with each release of JSword) 2. InstalledIndex.prop file for "Installed.Index.Version.xx" values that should stay persistent on clients computer between upgrades
> Support for PerBookVersion property: Since index creation api is per Book based, added support for (optional) PerBookVersion properties to allow selective upgrade of one book's index, if needed.
> This pull request, still assumes index version as 1.2, so should not break anything
> Notes: Looked into storing version values in the lucene index using FlexibleIndexing in lucene 4.0, but that seem very dependent on lucene api. Prop file gives human readable configuration and easy to debug.
> 
> ToDo/Questions: 
> 1. Managing the add/update of values in InstalledIndex.prop programmatically
> 2. Need recommendation on suitable location for InstalledIndex.prop file (perhaps as {IndexFolder}/JSword/lucene/js.index.metadata.prop file) 
> 3. Need to add reindexAllBooksIfNeeded() API, that folks (AndBible, BD, Alkitab and?) can use to upgrade all index as bulk, for the installed books , only then the DefaultInstalledVersion can be updated. o.c.j.bridge.BookIndexer.java shows a sample API in the comments. 
> 4. How do the clients want the DownloadIndex option to work with index versioning?
> 
> You can merge this Pull Request by running
> 
>   git pull https://github.com/sijocherian/jsword master
> Or view, comment on, or merge it at:
> 
>   https://github.com/crosswire/jsword/pull/74
> 
> Commit Summary
> 
> JS-98 : mechanism to detect if index need to be recreated by comparing IndexMetadata from prop file for now Started partially with the patch from Tonny Kohar dated 15/May/09
> - Added InstalledIndex.prop file (location of this file TBD)
> File Changes
> 
> M src/main/java/org/crosswire/jsword/bridge/BookIndexer.java (20)
> M src/main/java/org/crosswire/jsword/index/IndexManager.java (16)
> M src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.java (29)
> A src/main/java/org/crosswire/jsword/index/lucene/InstalledIndex.java (67)
> M src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java (53)
> M src/main/resources/IndexMetadata.properties (18)
> A src/main/resources/InstalledIndex.properties (39)
> A src/test/java/org/crosswire/jsword/index/lucene/LuceneIndexManagerTest.java (131)
> Patch Links:
> 
> https://github.com/crosswire/jsword/pull/74.patch
> https://github.com/crosswire/jsword/pull/74.diff
>> Reply to this email directly or view it on GitHub.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140330/800ec22b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140330/800ec22b/attachment.p7s>


More information about the jsword-devel mailing list