<div dir="ltr">The issue with this method here. Lucene relies on getGlobalKeyList, but that doesn't return the right number of keys. It seems to chop off the end<div><br></div><div><div>@Override</div><div> public Key getGlobalKeyList() throws BookException {</div>
<div> ZVerseBackendState rafBook = null;</div><div> try {</div><div> rafBook = initState();</div><div><br></div><div> String v11nName = getBookMetaData().getProperty(ConfigEntryType.VERSIFICATION).toString();</div>
<div> Versification v11n = Versifications.instance().getVersification(v11nName);</div><div><br></div><div> Testament[] testaments = new Testament[] {</div><div> Testament.OLD, Testament.NEW</div>
<div> };</div><div><br></div><div> BitwisePassage passage = new RocketPassage(v11n);</div><div> passage.raiseEventSuppresion();</div><div> passage.raiseNormalizeProtection();</div>
<div><br></div><div> for (Testament currentTestament : testaments) {</div><div> RandomAccessFile idxRaf = rafBook.getIdxRaf(currentTestament);</div><div><br></div><div> // If Bible does not contain the desired testament, then false</div>
<div> if (idxRaf == null) {</div><div> // no keys in this testament</div><div> continue;</div><div> }</div><div><br></div><div> int maxIndex = v11n.getCount(currentTestament) - 1;</div>
<div><br></div><div> // Read in the whole index, a few hundred Kb at most.</div><div> byte[] temp = SwordUtil.readRAF(idxRaf, 0, IDX_ENTRY_SIZE * maxIndex);</div><div><br></div><div> // For each entry of 10 bytes, the length of the verse in bytes</div>
<div> // is in the last 2 bytes. If both bytes are 0, then there is no content.</div><div> for (int ii = 0; ii < temp.length; ii += IDX_ENTRY_SIZE) {</div><div> // This can be simplified to temp[ii + 8] == 0 && temp[ii + 9] == 0.</div>
<div> // int verseSize = SwordUtil.decodeLittleEndian16(temp, ii + 8);</div><div> // if (verseSize > 0) {</div><div> if (temp[ii + 8] != 0 || temp[ii + 9] != 0) {</div>
<div> int ordinal = ii / IDX_ENTRY_SIZE;</div><div> passage.addVersifiedOrdinal(v11n.getOrdinal(currentTestament, ordinal));</div><div> }</div><div> }</div>
<div> }</div><div><br></div><div> passage.lowerNormalizeProtection();</div><div> passage.lowerEventSuppressionAndTest();</div><div><br></div><div> return passage;</div><div> } catch (IOException e) {</div>
<div> throw new BookException(JSMsg.gettext("Unable to read key list from book."));</div><div> } finally {</div><div> OpenFileStateManager.release(rafBook);</div><div> }</div>
<div> }</div></div><div><br></div><div>Chris</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 19 July 2014 11:15, Martin Denham <span dir="ltr"><<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">For clarification, this is different to the search problem I mentioned yesterday.<div><br></div><div>I won't be able to look at this for at least a few days, and I am not so knowledgeable regarding Lucene, so if anybody else fixes it in the mean time - great.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Martin</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 19 July 2014 09:24, Martin Denham <span dir="ltr"><<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This bug affects both STEP and And Bible so it probably affects most JSword apps.<div><br></div><div>No search results are returned for the last 2 verses of Revelation.</div>
<div><br></div><div><b>Examples</b></div>
<div>If you <a href="http://www.stepbible.org/?q=version=ESV%7Ctext=Amen&options=VNHUG&pos=1" target="_blank">search for 'Amen'</a> you see many results but the last is in Rev 19, not Rev 22 and the last 2 verses of Revelation contain Amen.</div>
<div><br></div><div><a href="http://www.stepbible.org/?q=version=ESV%7Creference=Rev.22%7Ctext=Jesus&options=VNHUG&pos=1" target="_blank">Searching for 'Jesus' in Rev 22</a> yields only verse which is verse 16 and omits verses 21 and 22.</div>
<span><font color="#888888">
<div><br></div><div>Martin</div></font></span></div>
</blockquote></div><br></div>
</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></div>