<div dir="ltr"><blockquote type="cite" style="font-family:arial,sans-serif;font-size:13px"><p><span style="font-family:arial;font-size:small">I will appreciate feedback or concern from jsword users (And,BD..) on having a property file to store current index version (currently indexed default version + per-book&#39;s index version, if different).</span><br>
</p><p><span style="font-family:arial;font-size:small">After that, any recommendation on suitable location for this file (I am thinking {IndexFolder}/JSword/lucene/</span><span style="font-family:arial;font-size:small">js.index.metadata.prop file). I am not sure if all platforms have same folder structure (like&nbsp;</span><span style="font-family:arial;font-size:small">JSword/lucene)</span><br>
</p></blockquote><blockquote type="cite" style="font-family:arial,sans-serif;font-size:13px"><p><span style="font-family:arial;font-size:small">note: In code comments, I am referring to this file as&nbsp;</span><span style="font-size:small;font-family:arial">InstalledIndex.prop.</span><span style="font-family:arial;font-size:small"><br>
</span></p><p><span style="font-size:small;font-family:arial"><br></span></p><p><span style="font-size:small;font-family:arial">Many thanks,</span></p><p><span style="font-size:small;font-family:arial">sijo</span></p></blockquote>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 30, 2014 at 4:27 PM, DM Smith <span dir="ltr">&lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Sijo asked this via github. Thought it&#39;d be good to get feedback here.<div><br></div>
<div>-- DM<br><div><br><div>Begin forwarded message:</div><br><blockquote type="cite"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;color:rgba(0,0,0,1.0)"><b>From: </b></span><span style="font-family:&#39;Helvetica&#39;">Sijo Cherian &lt;<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>&gt;<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;color:rgba(0,0,0,1.0)"><b>Subject: </b></span><span style="font-family:&#39;Helvetica&#39;"><b>[jsword] JS-98: IndexManager.needsReindexing(Book book); as the API to detect if per-book index need to be recreated  (#74)</b><br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;color:rgba(0,0,0,1.0)"><b>Date: </b></span><span style="font-family:&#39;Helvetica&#39;">March 29, 2014 at 7:31:52 PM EDT<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;color:rgba(0,0,0,1.0)"><b>To: </b></span><span style="font-family:&#39;Helvetica&#39;">crosswire/jsword &lt;<a href="mailto:jsword@noreply.github.com" target="_blank">jsword@noreply.github.com</a>&gt;<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;color:rgba(0,0,0,1.0)"><b>Reply-To: </b></span><span style="font-family:&#39;Helvetica&#39;">crosswire/jsword &lt;<a href="mailto:reply+i-30455246-2897689b705296a200fa088d2af792bed6bc6a4a-1645068@reply.github.com" target="_blank">reply+i-30455246-2897689b705296a200fa088d2af792bed6bc6a4a-1645068@reply.github.com</a>&gt;<br>
</span></div><br><div><p>Following is the upgrade criteria implemented by comparing IndexMetadata from prop files: needsReindexing returns true, if Latest.Index.Version.xxx &gt; Installed.Index.Version.xxx OR if {index folder} is not found at all.</p>


<ul>
<li>For now uses two prop file: 1. IndexMetadata.prop file (can be updated with each release of JSword) 2. InstalledIndex.prop file for &quot;Installed.Index.Version.xx&quot; values that should stay persistent on clients computer between upgrades</li>

<li>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&#39;s index, if needed.</li>
<li>This pull request, still assumes index version as 1.2, so should not break anything</li>
</ul><p>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.   </p>
<p>ToDo/Questions: <br>
1. Managing the add/update of values in InstalledIndex.prop programmatically<br>
2. Need recommendation on suitable location for InstalledIndex.prop file (perhaps as {IndexFolder}/JSword/lucene/js.index.metadata.prop  file) <br>
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. <br>

4. How do the clients want the DownloadIndex option to work with index versioning?</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull <a href="https://github.com/sijocherian/jsword" target="_blank">https://github.com/sijocherian/jsword</a> master</pre><p>Or view, comment on, or merge it at:</p><p>&nbsp;&nbsp;<a href="https://github.com/crosswire/jsword/pull/74" target="_blank">https://github.com/crosswire/jsword/pull/74</a></p>


<h4>Commit Summary</h4>
<ul>
  <li>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</li>
  <li>- Added InstalledIndex.prop file (location of this file TBD)</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-0" target="_blank">src/main/java/org/crosswire/jsword/bridge/BookIndexer.java</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-1" target="_blank">src/main/java/org/crosswire/jsword/index/IndexManager.java</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-2" target="_blank">src/main/java/org/crosswire/jsword/index/lucene/IndexMetadata.java</a>
    (29)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-3" target="_blank">src/main/java/org/crosswire/jsword/index/lucene/InstalledIndex.java</a>
    (67)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-4" target="_blank">src/main/java/org/crosswire/jsword/index/lucene/LuceneIndexManager.java</a>
    (53)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-5" target="_blank">src/main/resources/IndexMetadata.properties</a>
    (18)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-6" target="_blank">src/main/resources/InstalledIndex.properties</a>
    (39)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/crosswire/jsword/pull/74/files#diff-7" target="_blank">src/test/java/org/crosswire/jsword/index/lucene/LuceneIndexManagerTest.java</a>
    (131)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href="https://github.com/crosswire/jsword/pull/74.patch" target="_blank">https://github.com/crosswire/jsword/pull/74.patch</a></li>
  <li><a href="https://github.com/crosswire/jsword/pull/74.diff" target="_blank">https://github.com/crosswire/jsword/pull/74.diff</a></li>
</ul><p style="font-size:small;color:#666">&mdash;<br>Reply to this email directly or <a href="https://github.com/crosswire/jsword/pull/74" target="_blank">view it on GitHub</a>.<img height="1" width="1"></p>
</div></blockquote></div><br></div></div><br>_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Sijo
</div>