[jsword-svn] r966 - in trunk:
jsword/src/main/java/org/crosswire/jsword/book/query
jsword/src/main/java/org/crosswire/jsword/book/query/basic
jsword/src/main/java/org/crosswire/jsword/book/search
jsword/src/main/java/org/crosswire/jsword/book/search/lucene
jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse
dmsmith at crosswire.org
dmsmith at crosswire.org
Sun Jan 22 18:36:05 MST 2006
Author: dmsmith
Date: 2006-01-22 18:35:36 -0700 (Sun, 22 Jan 2006)
New Revision: 966
Added:
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.properties
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecoratorFactory.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/basic/NullQuery.java
Removed:
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java
Modified:
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryBuilderFactory.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/search/SearchType.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryBuilder.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryDecorator.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/Msg.java
Log:
Fix bugs in search.
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryBuilderFactory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryBuilderFactory.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryBuilderFactory.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -17,7 +17,7 @@
* Copyright: 2005
* The copyright to this program is held by it's authors.
*
- * ID: $Id: SearchSyntaxFactory.java 763 2005-07-27 23:26:43Z dmsmith $
+ * ID: $Id: QueryDecoratorFactory.java 763 2005-07-27 23:26:43Z dmsmith $
*/
package org.crosswire.jsword.book.query;
@@ -25,7 +25,7 @@
import org.crosswire.common.util.Logger;
/**
- * A Factory class for SearchSyntax.
+ * A Factory class for QueryDecorator.
*
* @see gnu.lgpl.License for license details.
* The copyright to this program is held by it's authors.
Copied: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.java (from rev 964, trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.java)
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.java 2006-01-22 15:10:00 UTC (rev 964)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -0,0 +1,47 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ * http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ * The copyright to this program is held by it's authors.
+ *
+ * ID: $Id$
+ */
+package org.crosswire.jsword.book.query;
+
+/**
+ * A QueryDecorator allows for the decoration of strings in a way that is
+ * appropriate for the Searcher.
+ *
+ * @see gnu.lgpl.License for license details.
+ * The copyright to this program is held by it's authors.
+ * @author DM Smith [ dmsmith555 at yahoo dot com]
+ */
+public interface QueryDecorator
+{
+ String decoratePhrase(String queryWords);
+
+ String decorateAllWords(String queryWords);
+
+ String decorateAnyWords(String queryWords);
+
+ String decorateNotWords(String queryWords);
+
+ String decorateStartWords(String queryWords);
+
+ String decorateSpellWords(String queryWords);
+
+ String decorateRange(String queryWords);
+}
Copied: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.properties (from rev 964, trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties)
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties 2006-01-22 15:10:00 UTC (rev 964)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecorator.properties 2006-01-23 01:35:36 UTC (rev 966)
@@ -0,0 +1 @@
+default=org.crosswire.jsword.book.search.lucene.LuceneQueryDecorator
\ No newline at end of file
Copied: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecoratorFactory.java (from rev 964, trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java)
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java 2006-01-22 15:10:00 UTC (rev 964)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/QueryDecoratorFactory.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -0,0 +1,76 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ * http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ * The copyright to this program is held by it's authors.
+ *
+ * ID: $Id$
+ */
+package org.crosswire.jsword.book.query;
+
+import org.crosswire.common.util.ClassUtil;
+import org.crosswire.common.util.Logger;
+
+/**
+ * A Factory class for QueryDecorator.
+ *
+ * @see gnu.lgpl.License for license details.
+ * The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public final class QueryDecoratorFactory
+{
+ /**
+ * Prevent Instansiation
+ */
+ private QueryDecoratorFactory()
+ {
+ }
+
+ /**
+ * Create a new QueryDecorator.
+ */
+ public static QueryDecorator getSearchSyntax()
+ {
+ return instance;
+ }
+
+ /**
+ * The singleton
+ */
+ private static QueryDecorator instance;
+
+ /**
+ * The log stream
+ */
+ private static final Logger log = Logger.getLogger(QueryDecoratorFactory.class);
+
+ /**
+ * Setup the instance
+ */
+ static
+ {
+ try
+ {
+ Class impl = ClassUtil.getImplementor(QueryDecorator.class);
+ instance = (QueryDecorator) impl.newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.error("create Query Decorator failed", ex); //$NON-NLS-1$
+ }
+ }
+}
Deleted: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntax.properties 2006-01-23 01:35:36 UTC (rev 966)
@@ -1 +0,0 @@
-default=org.crosswire.jsword.book.search.lucene.ExtendedLuceneSyntax
\ No newline at end of file
Deleted: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/SearchSyntaxFactory.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -1,76 +0,0 @@
-/**
- * Distribution License:
- * JSword is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License, version 2.1 as published by
- * the Free Software Foundation. This program is distributed in the hope
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU Lesser General Public License for more details.
- *
- * The License is available on the internet at:
- * http://www.gnu.org/copyleft/lgpl.html
- * or by writing to:
- * Free Software Foundation, Inc.
- * 59 Temple Place - Suite 330
- * Boston, MA 02111-1307, USA
- *
- * Copyright: 2005
- * The copyright to this program is held by it's authors.
- *
- * ID: $Id$
- */
-package org.crosswire.jsword.book.query;
-
-import org.crosswire.common.util.ClassUtil;
-import org.crosswire.common.util.Logger;
-
-/**
- * A Factory class for SearchSyntax.
- *
- * @see gnu.lgpl.License for license details.
- * The copyright to this program is held by it's authors.
- * @author DM Smith [dmsmith555 at yahoo dot com]
- */
-public final class SearchSyntaxFactory
-{
- /**
- * Prevent Instansiation
- */
- private SearchSyntaxFactory()
- {
- }
-
- /**
- * Create a new SearchSyntax.
- */
- public static SearchSyntax getSearchSyntax()
- {
- return instance;
- }
-
- /**
- * The singleton
- */
- private static SearchSyntax instance;
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(SearchSyntaxFactory.class);
-
- /**
- * Setup the instance
- */
- static
- {
- try
- {
- Class impl = ClassUtil.getImplementor(SearchSyntax.class);
- instance = (SearchSyntax) impl.newInstance();
- }
- catch (Exception ex)
- {
- log.error("createIndexManager failed", ex); //$NON-NLS-1$
- }
- }
-}
Added: trunk/jsword/src/main/java/org/crosswire/jsword/book/query/basic/NullQuery.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/query/basic/NullQuery.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/query/basic/NullQuery.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -0,0 +1,53 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ * http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ * The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: OrQuery.java 964 2006-01-22 10:10:00 -0500 (Sun, 22 Jan 2006) dmsmith $
+ */
+package org.crosswire.jsword.book.query.basic;
+
+import org.crosswire.jsword.book.BookException;
+import org.crosswire.jsword.book.query.Query;
+import org.crosswire.jsword.book.search.Index;
+import org.crosswire.jsword.passage.Key;
+
+/**
+ * A null query searches for nothing and returns an empty Key.
+ *
+ * @see gnu.lgpl.License for license details.
+ * The copyright to this program is held by it's authors.
+ * @author DM Smith [ dmsmith555 at yahoo dot com]
+ */
+public class NullQuery implements Query
+{
+ /**
+ * Create a NullQuery.
+ */
+ public NullQuery()
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.crosswire.jsword.book.query.Query#find(org.crosswire.jsword.book.search.Index)
+ */
+ public Key find(Index index) throws BookException
+ {
+ return index.find(null);
+ }
+
+}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/search/SearchType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/search/SearchType.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/search/SearchType.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -23,8 +23,8 @@
import java.io.Serializable;
-import org.crosswire.jsword.book.query.SearchSyntax;
-import org.crosswire.jsword.book.query.SearchSyntaxFactory;
+import org.crosswire.jsword.book.query.QueryDecorator;
+import org.crosswire.jsword.book.query.QueryDecoratorFactory;
/**
* An Enumeration of the possible types of Searches.
@@ -237,7 +237,7 @@
*/
private String name;
- protected static final SearchSyntax SEARCH_SYNTAX = SearchSyntaxFactory.getSearchSyntax();
+ protected static final QueryDecorator SEARCH_SYNTAX = QueryDecoratorFactory.getSearchSyntax();
// Support for serialization
private static int nextObj;
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryBuilder.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryBuilder.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryBuilder.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -21,16 +21,16 @@
*/
package org.crosswire.jsword.book.search.lucene;
-import java.util.ArrayList;
-import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.crosswire.jsword.book.query.Query;
+import org.crosswire.jsword.book.query.QueryBuilder;
import org.crosswire.jsword.book.query.basic.AndNotQuery;
import org.crosswire.jsword.book.query.basic.AndQuery;
import org.crosswire.jsword.book.query.basic.BaseQuery;
import org.crosswire.jsword.book.query.basic.BlurQuery;
+import org.crosswire.jsword.book.query.basic.NullQuery;
import org.crosswire.jsword.book.query.basic.RangeQuery;
/**
@@ -44,84 +44,75 @@
* The copyright to this program is held by it's authors.
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
-public final class LuceneQueryBuilder
+public final class LuceneQueryBuilder implements QueryBuilder
{
/**
* Prevent Instansiation
*/
- private LuceneQueryBuilder()
+ public LuceneQueryBuilder()
{
}
- /**
- * Tokenize a query into a list of Tokens.
- * @param aSearch The text to parse
- * @return A List of selected Tokens
+ /* (non-Javadoc)
+ * @see org.crosswire.jsword.book.query.QueryBuilder#parse(java.lang.String)
*/
- public static List tokenize(String aSearch)
+ public Query parse(String aSearch)
{
+ Query query = NULL_QUERY;
+
String sought = aSearch;
- List output = new ArrayList();
if (sought == null || sought.length() == 0)
{
- return output;
+ return query;
}
int i = 0;
- Query query = null;
Query range = null;
- String rangeModifier = null;
+ String rangeModifier = ""; //$NON-NLS-1$
// Look for a range +[...], -[...], or [...]
Matcher rangeMatcher = RANGE_PATTERN.matcher(sought);
if (rangeMatcher.find())
{
rangeModifier = rangeMatcher.group(1);
range = new RangeQuery(rangeMatcher.group(2));
- sought = sought.substring(rangeMatcher.end() - 1);
+ sought = sought.substring(rangeMatcher.end());
}
// Look for a blur ~n
Matcher blurMatcher = BLUR_PATTERN.matcher(sought);
if (blurMatcher.find())
{
- int blurFactor = 1;
// Did we have ~ or ~n?
- if (blurMatcher.groupCount() > 0)
+ int blurFactor = 1;
+ String blur = blurMatcher.group(1);
+ if (blur.length() > 0)
{
- blurFactor = Integer.valueOf(blurMatcher.group(1)).intValue();
+ blurFactor = Integer.valueOf(blur).intValue();
}
Query left = new BaseQuery(sought.substring(i, blurMatcher.start()));
Query right = new BaseQuery(sought.substring(blurMatcher.end()));
query = new BlurQuery(left, right, blurFactor);
}
- else
+ else if (sought.length() > 0)
{
query = new BaseQuery(sought);
}
- if (range != null)
+ if (range != null && !NULL_QUERY.equals(query))
{
- if (rangeModifier == null)
+ if (rangeModifier.length() == 0 || rangeModifier.charAt(0) == '+')
{
- output.add(query);
- output.add(range);
+ query = new AndQuery(range, query);
}
- else if (rangeModifier.charAt(0) == '+')
- {
- output.add(new AndQuery(query, range));
- }
else
{
// AndNot needs to be after what it is restricting
- output.add(new AndNotQuery(query, range));
+ query = new AndNotQuery(query, range);
}
}
- else
- {
- output.add(query);
- }
- return output;
+
+ return query;
}
/**
@@ -137,4 +128,9 @@
*/
private static final Pattern BLUR_PATTERN = Pattern.compile("\\s~(\\d*)?\\s"); //$NON-NLS-1$
+ /**
+ * A query that returns nothing.
+ */
+ private static final Query NULL_QUERY = new NullQuery();
+
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryDecorator.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryDecorator.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/LuceneQueryDecorator.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -22,7 +22,7 @@
package org.crosswire.jsword.book.search.lucene;
import org.crosswire.common.util.StringUtil;
-import org.crosswire.jsword.book.query.SearchSyntax;
+import org.crosswire.jsword.book.query.QueryDecorator;
/**
* LuceneQueryDecorator represents the extension of stock Lucene syntax
@@ -32,16 +32,8 @@
* The copyright to this program is held by it's authors.
* @author DM Smith [ dmsmith555 at yahoo dot com]
*/
-public class LuceneQueryDecorator implements SearchSyntax
+public class LuceneQueryDecorator implements QueryDecorator
{
- private char quote = '"';
- private char plus = '+';
- private char minus = '-';
- private char open = '[';
- private char close = ']';
- private char fuzzy = '~';
- private char wild = '*';
-
/* (non-Javadoc)
* @see org.crosswire.jsword.book.search.SearchSyntax#decorateAllWords(java.lang.String)
*/
@@ -49,8 +41,8 @@
{
String[] words = queryWords.split(SPACE);
StringBuffer search = new StringBuffer();
- search.append(plus);
- search.append(StringUtil.join(words, SPACE + plus));
+ search.append(PLUS);
+ search.append(StringUtil.join(words, SPACE_PLUS));
return search.toString();
}
@@ -70,9 +62,9 @@
{
// This performs a best match
StringBuffer search = new StringBuffer();
- search.append(quote);
+ search.append(QUOTE);
search.append(queryWords);
- search.append(quote);
+ search.append(QUOTE);
return search.toString();
}
@@ -83,8 +75,8 @@
{
String[] words = queryWords.split(SPACE);
StringBuffer search = new StringBuffer();
- search.append(minus);
- search.append(StringUtil.join(words, SPACE + minus));
+ search.append(MINUS);
+ search.append(StringUtil.join(words, SPACE_MINUS));
return search.toString();
}
@@ -94,10 +86,10 @@
public String decorateRange(String queryWords)
{
StringBuffer search = new StringBuffer();
- search.append(plus);
- search.append(open);
+ search.append(PLUS);
+ search.append(OPEN);
search.append(queryWords);
- search.append(close);
+ search.append(CLOSE);
return search.toString();
}
@@ -107,8 +99,8 @@
public String decorateSpellWords(String queryWords)
{
String[] words = queryWords.split(SPACE);
- StringBuffer search = new StringBuffer(StringUtil.join(words, SPACE + fuzzy));
- search.append(fuzzy);
+ StringBuffer search = new StringBuffer(StringUtil.join(words, FUZZY_SPACE));
+ search.append(FUZZY);
return search.toString();
}
@@ -118,8 +110,8 @@
public String decorateStartWords(String queryWords)
{
String[] words = queryWords.split(SPACE);
- StringBuffer search = new StringBuffer(StringUtil.join(words, SPACE + wild));
- search.append(wild);
+ StringBuffer search = new StringBuffer(StringUtil.join(words, WILD_SPACE));
+ search.append(WILD);
return search.toString();
}
@@ -128,4 +120,20 @@
* one and that we don't have lots of NON-NLS comments everywhere
*/
private static final String SPACE = " "; //$NON-NLS-1$
+ private static final char QUOTE = '"';
+ private static final char PLUS = '+';
+ private static final String SPACE_PLUS = " +"; //$NON-NLS-1$
+
+ private static final char MINUS = '-';
+ private static final String SPACE_MINUS = " -"; //$NON-NLS-1$
+
+ private static final char OPEN = '[';
+ private static final char CLOSE = ']';
+
+ private static final char FUZZY = '~';
+ private static final String FUZZY_SPACE = "~ "; //$NON-NLS-1$
+
+ private static final char WILD = '*';
+ private static final String WILD_SPACE = "* "; //$NON-NLS-1$
+
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/Msg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/Msg.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/search/lucene/Msg.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -42,7 +42,6 @@
static final Msg DELETE_FAILED = new Msg("LuceneIndex.DeleteFailed"); //$NON-NLS-1$
static final Msg INSTALL_FAIL = new Msg("LuceneIndex.InstallFailed"); //$NON-NLS-1$
static final Msg BAD_VERSE = new Msg("LuceneIndex.BadVerse"); //$NON-NLS-1$
- static final Msg ILLEGAL_PASSAGE = new Msg("RangeQuery.IllegalPassage"); //$NON-NLS-1$
/**
* Passthrough ctor
Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java 2006-01-22 15:15:16 UTC (rev 965)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/parse/IndexSearcher.java 2006-01-23 01:35:36 UTC (rev 966)
@@ -31,6 +31,7 @@
import org.crosswire.common.util.Logger;
import org.crosswire.common.util.ResourceUtil;
import org.crosswire.jsword.book.BookException;
+import org.crosswire.jsword.book.query.Query;
import org.crosswire.jsword.book.search.Index;
import org.crosswire.jsword.book.search.SearchRequest;
import org.crosswire.jsword.book.search.Searcher;
@@ -69,6 +70,14 @@
/* (non-Javadoc)
* @see org.crosswire.jsword.book.search.Searcher#search(java.lang.String)
*/
+ public Key search(Query request) throws BookException
+ {
+ return request.find(index);
+ }
+
+ /* (non-Javadoc)
+ * @see org.crosswire.jsword.book.search.Searcher#search(java.lang.String)
+ */
public Key search(String request) throws BookException
{
return search(new DefaultSearchRequest(request));
More information about the jsword-svn
mailing list