Class: BooleanQuery

helma.Search.BooleanQuery(String, String)

This class represents a Boolean Query, providing various methods for combining other Query instances using boolean operators.

Constructor

new BooleanQuery(String, String)

Creates a new instance of helma.Search.BooleanQuery
Parameters:
Name Type Description
String name of the field
String query string
Source:
Returns:
Object BooleanQuery object

Extends

Members

query :org.apache.lucene.search.BooleanQuery

Contains the wrapped BooleanQuery instance
Type:
  • org.apache.lucene.search.BooleanQuery
Overrides:
  • helma.Search.Query#query
Source:

Methods

addQuery(q, clause)

Adds an additional query clause to this query.
Parameters:
Name Type Description
q helma.Search.Query The query to add
clause String Boolean clause ("or", "not", or "and", default is "and")
Source:

addTerm(field, str, clause, analyzer)

Adds a term to the wrapped query object. This method can be called with two, three or four arguments, eg.:
addTerm("fieldname", "querystring")
addTerm("fieldname", "querystring", "and")
addTerm("fieldname", "querystring", helma.Search.getAnalyzer("de"))
addTerm("fieldname", "querystring", "not", helma.Search.getAnalyzer("simple"))
Parameters:
Name Type Description
field String | Array Either a String or an Array containing Strings that determine the index field(s) to match
str String Query string to match
clause String Boolean clause ("or", "not" or "and", default is "and")
analyzer org.apache.lucene.analysis.Analyzer An analyzer to use
Source:

getBoost()

Returns the boost factor of this query.
Inherited From:
Source:

getQuery()

Returns the wrapped Lucene Query object.
Inherited From:
Source:
Returns:
The wrapped query object

setBoost(fact)

Sets the boost factor of this query clause to the given number. Documents matching this query will have their score multiplied with the given factor
Parameters:
Name Type Description
fact Number The factor to multiply the score of matching documents with.
Inherited From:
Source: