Hi,
I have a secnario where i m searching the result on the basis of
checkbox,when i check the particual check box it passes an id called
as "county_id", no i have county_id in my database and when i m trying
to search the data according to "county_id", its gives me a nil
result ,though i have data with that particular county id ..
the steps i follwoed are
1 created a filed in my table naming county id.
2 in my model i added these lines
define_index do
indexes nonprofit_name
indexes city
has county_id
# has city
set_property :delta => true
set_property :enable_star => true
set_property :min_prefix_len => 1
end
3 in my controller
def nonprofit_sort
if !params[:locations].blank? && !params[:search].blank?
@nonprofits = NonProfit.search params[:search],:with =>
{:county_id=> location(params[:locations])},:star => true
elsif !params[:locations].blank?
@nonprofits = NonProfit.search params[:search],:with =>
{:county_id => location(params[:locations])},:star => truep "finished
search"
elsif !params[:search].blank?
@nonprofits = NonProfit.search params[:search],:star => true
else
@nonprofits= NonProfit.search params[:search],:star => true
end
end
4. Rebuilded the index
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.