[jsword-devel] Search query bug?

Chris Burrell chris at burrell.me.uk
Mon Jul 9 11:11:52 MST 2012


Hi

Using a normal ranked search, I seem to be hitting some bug for a "strong"
search. If I search for g0016, G016 or G16 I get results back. For G0016
however, it comes back with nothing.

Code I used is below. Any ideas? The obvious work around is to do things in
lower case, but I assume that is a bug?
Chris




final DefaultSearchModifier modifier = new DefaultSearchModifier();

        modifier.setRanked(true);
        modifier.setMaxResults(MAX_RESULTS);

        final Book bible = this.av11nService.getBookFromVersion(version);

        try {
            final Key results = bible.find(new DefaultSearchRequest(query,
modifier));

            final List<SearchEntry> resultPassages = new
ArrayList<SearchEntry>();
            final Iterator<Key> rangeIter = ((Passage)
results).rangeIterator(RestrictionType.CHAPTER);
            // boundaries.
            while (rangeIter.hasNext()) {
                final Key range = rangeIter.next();
                final BookData data = new BookData(bible, range);
                final String canonicalText =
OSISUtil.getCanonicalText(data.getOsisFragment());
                resultPassages.add(new SearchEntry(range.getName(),
canonicalText));
            }

            final SearchResult r = new SearchResult();
            r.setResults(resultPassages);
            r.setQuery(query);
            r.setMaxReached(MAX_RESULTS == resultPassages.size());

            return r;
        } catch (final BookException e) {
            throw new StepInternalException("Unable to search for " + query
+ " with Bible " + version, e);
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20120709/c0ce8c6d/attachment.html>


More information about the jsword-devel mailing list