Displaying 2 results from an estimated 2 matches for "selected_types".
2006 Mar 30
4
Select List to change type of STI class
Hi:
I''m trying to create a drop-down list to change the type of a Single
Table Inheritance class. I tried this:
<%= select :user, :type, [ [''Author'', ''Author''],
[''Editor'', ''Editor''],
[''Administrator'', ''Administrator''] ]
2006 Jun 27
2
Using QueryParser vs building my own query
...ed I should build my own query instead of
relying on QueryParser to do the job for me, but I''ve hit a strange
problem..
Here''s how I build my query:
#Main query
query = Ferret::Search::BooleanQuery.new
#Build query to match types
typesquery = Ferret::Search::BooleanQuery.new
@selected_types.each{|type|
typesquery.add_query(
Ferret::Search::TermQuery.new(Ferret::Index::Term.new(''type'',
type)),
Ferret::Search::BooleanClause::Occur::SHOULD
)
}
#Add types query to main query
query.add_query(typesquery, Ferret::Search::BooleanClause::Occur::MUST)
#Build que...