Class | Ferret::Search::BooleanQuery::BooleanClause |
In: |
ext/r_search.c
|
Parent: | Object |
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.
clause1 = BooleanClause.new(query1, :should) clause2 = BooleanClause.new(query2, :should) query = BooleanQuery.new query << clause1 << clause2
Create a new BooleanClause object, wrapping the query query. occur must be one of +:must+, +:should+ or +:must_not+.
Set the occur value for this BooleanClause. occur must be one of +:must+, +:should+ or +:must_not+.
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+.