Class Ferret::Search::BooleanQuery::BooleanClause
In: ext/r_search.c
Parent: Object

Summary

A BooleanClause holes a single query within a BooleanQuery specifying wither the query +:must+ match, +:should+ match or +:must_not+ match. BooleanClauses can be used to pass a clause from one BooleanQuery to another although it is generally easier just to add a query directly to a BooleanQuery using the BooleanQuery#add_query method.

Example

  clause1 = BooleanClause.new(query1, :should)
  clause2 = BooleanClause.new(query2, :should)

  query = BooleanQuery.new
  query << clause1 << clause2

Methods

new   occur=   prohibited?   query   query=   required?   to_s  

Public Class methods

Create a new BooleanClause object, wrapping the query query. occur must be one of +:must+, +:should+ or +:must_not+.

Public Instance methods

Set the occur value for this BooleanClause. occur must be one of +:must+, +:should+ or +:must_not+.

Return true if this clause is prohibited. ie, this will be true if occur was equal to +:must_not+.

Returnt the query object wrapped by this BooleanClause.

Return true if this clause is required. ie, this will be true if occur was equal to +:must+.

Return a string representation of this clause. This will not be used by BooleanQuery#to_s. It is only used by BooleanClause#to_s and will specify whether the clause is +:must+, +:should+ or +:must_not+.

[Validate]