Sphinx 使用斯芬克斯搜索结果
我正在使用sphinx beta,并考虑使用sphinx来执行搜索功能Sphinx 使用斯芬克斯搜索结果,sphinx,thinking-sphinx,Sphinx,Thinking Sphinx,我正在使用sphinx beta,并考虑使用sphinx来执行搜索功能 wann should search for the word i entered in the database.which is populated with data already. so in my application Mydoc,i got articlesmodel and controller.. articles is db is populated with data. i wann to sear
wann should search for the word i entered in the database.which is populated with data already.
so in my application Mydoc,i got articlesmodel and controller.. articles is db is populated with data.
i wann to search for the data in articles..so far i ve done with following things but not getting the search result
=> created new search controller
def index
@articles = Article.search params[:search]
end
=> articles.rb(model)
define_index do
indexes name, :sortable => true
indexes description
indexes title, :sortable => true
end
def self.search(search)
ThinkingSphinx::Search
end
=> searches/index.html.erb
<%= form_tag do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "search", :name => nil %>
</p>
<% end %>
BUT WEN I CLICK ON THE SEARCH BUTTON ITS ASKING FOR CREATEACTION ?????
PLEASE COULD U HELP TO GET SEARCH RESULT
wann应该搜索我在数据库中输入的单词。该数据库已经填充了数据。
所以在我的应用程序Mydoc中,我得到了articlesmodel和controller。。文章是用数据填充数据库的。
我想在文章中搜索数据。到目前为止,我做了以下事情,但没有得到搜索结果
=>创建了新的搜索控制器
def索引
@articles=Article.search参数[:search]
结束
=>articles.rb(模型)
定义索引do
索引名称:sortable=>true
索引描述
索引标题:sortable=>true
结束
def self.search(搜索)
ThinkingSphinx::搜索
结束
=>搜索/index.html.erb
零%>
但我点击搜索按钮,它要求CREATEACTION?????
请你帮我查一下搜索结果好吗
您的表单正在向SearchController发出POST请求,这被解释为对创建操作的调用。尝试在表单中使用GET请求-类似以下内容:
<%= form_tag '', :method => :get do %>
:get do%>