I think there might be a problem with index creation code or .conf files. Comparing the Strongs index creation code (which works) with Headings:<div><br></div><div>In LuceneIndex you see:</div><div><div> boolean hasStrongs = book.getBookMetaData().hasFeature(FeatureType.STRONGS_NUMBERS);</div>
<div> boolean hasHeadings = book.getBookMetaData().hasFeature(FeatureType.HEADINGS);</div></div><div><br></div><div>Then in kjv.conf you see various attributes relating to Strongs and Headings but I believe the 3rd one is the one used by the above code in LuceneIndex::</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>GlobalOptionFilter=OSISStrongs</div></div><div><div>GlobalOptionFilter=OSISHeadings</div></div><div>Feature=StrongsNumbers</div></blockquote><div><br>
</div><div>However, in a module that contains headings like ESV in esv.conf there is no </div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>Feature=Headings</div></div></blockquote><div><br></div>
<div>So it may be that the headings do not make it into the index because of the following in LuceneIndex:</div><div><div> if (hasHeadings) {</div><div> addField(doc, headingField, OSISUtil.getHeadings(osis));</div>
<div> }</div></div><div><br></div><div>but DM will be able to confirm if that is the problem.</div><div><br></div><div>Martin</div><div><br><div class="gmail_quote">On 15 August 2012 20:06, Chris Burrell <span dir="ltr"><<a href="mailto:chris@burrell.me.uk" target="_blank">chris@burrell.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<div><br></div><div>I'm trying to search the headings of a particular book (say ESV).</div><div><br></div><div>
I'm using the following query "heading:*water*" which I was hoping should match "Jesus walks on Water" (case doesn't seem to make a difference).</div>
<div><div><br></div><div>My code is simply: bible.find(new DefaultSearchRequest(query, modifier));</div></div><div><br></div><div>Has anyone else managed to get this working?</div><div><br></div><div>Chris</div><div><br>
</div>
<div><br></div><div><br></div><div><div>final long start = System.currentTimeMillis();</div><div><br></div><div> final DefaultSearchModifier modifier = new DefaultSearchModifier();</div><div> modifier.setRanked(ranked);</div>
<div> modifier.setMaxResults(MAX_RESULTS);</div><div><br></div><div> final Book bible = this.av11nService.getBookFromVersion(version);</div><div><br></div><div> try {</div><div><br></div><div> final Key results;</div>
<div><br></div><div> // TODO JS-228 raised for thread-safety</div><div> synchronized (this) {</div><div> results = bible.find(new DefaultSearchRequest(query, modifier));</div><div> }</div>
<div><br></div><div> LOGGER.debug("[{}] verses found.", results.getCardinality());</div><div><br></div><div> if (ranked) {</div><div> rankAndTrimResults(results, MAX_RESULTS);</div>
<div> } else {</div><div> trimResults(results, MAX_RESULTS);</div><div> }</div><div> LOGGER.debug("Trimmed down to [{}].", results.getCardinality());</div><div><br>
</div><div> final long startRefs = System.currentTimeMillis();</div><div> final List<SearchEntry> resultPassages = getPassagesForResults(bible, results);</div><div> final long endRefs = System.currentTimeMillis();</div>
<div><br></div><div> return getSearchResult(query, start, startRefs, endRefs, resultPassages);</div><div> } catch (final BookException e) {</div><div> throw new StepInternalException("Unable to search for " + query + " with Bible " + version, e);</div>
<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>