org.crosswire.jsword.index.lucene
Class LuceneQueryBuilder

java.lang.Object
  extended by org.crosswire.jsword.index.lucene.LuceneQueryBuilder
All Implemented Interfaces:
QueryBuilder

public final class LuceneQueryBuilder
extends Object
implements QueryBuilder

A query can have a optional range specifier and an optional blur specifier. The range specifier can be +[range], -[range] or just [range]. This must stand at the beginning of the query and may be surrounded by whitespace. The blur specifier is either ~ or ~n, where ~ means adjacent verses, but ~n means to blur by n verses.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
private static Pattern BLUR_PATTERN
          The pattern of a blur.
private static Query NULL_QUERY
          A query that returns nothing.
private static Pattern RANGE_PATTERN
          The pattern of a range.
 
Constructor Summary
LuceneQueryBuilder()
          Prevent Instansiation
 
Method Summary
 Query parse(String aSearch)
          Construct a query from a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGE_PATTERN

private static final Pattern RANGE_PATTERN
The pattern of a range. This is anything that is contained between a leading [] (but not containing a [ or ]), with a + or - optional prefix, perhaps surrounded by whitespace.


BLUR_PATTERN

private static final Pattern BLUR_PATTERN
The pattern of a blur. A '~', optionally followed by a number, representing the number of verses.


NULL_QUERY

private static final Query NULL_QUERY
A query that returns nothing.

Constructor Detail

LuceneQueryBuilder

public LuceneQueryBuilder()
Prevent Instansiation

Method Detail

parse

public Query parse(String aSearch)
Description copied from interface: QueryBuilder
Construct a query from a string.

Specified by:
parse in interface QueryBuilder
Parameters:
aSearch - The text to convert
Returns:
a query.

Copyright ยจ 2003-2006