moving the simple query thingy into a different method/view so that I can turn the index method/view into something more like the Solr builtin browse view
This commit is contained in:
parent
b47a145ef6
commit
048b3881f9
@ -5,7 +5,7 @@ require 'rexml/document'
|
|||||||
class SolrController < ApplicationController
|
class SolrController < ApplicationController
|
||||||
include SolrHelper
|
include SolrHelper
|
||||||
|
|
||||||
def index
|
def simple_query
|
||||||
@search = request[:q]
|
@search = request[:q]
|
||||||
@results = []
|
@results = []
|
||||||
if @search != nil
|
if @search != nil
|
||||||
@ -13,4 +13,6 @@ class SolrController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,15 +1 @@
|
|||||||
<h1>Find Stuff!</h1>
|
<h1>Index</h1>
|
||||||
|
|
||||||
<form action="" method="get" name="query">
|
|
||||||
<input type="text" name="q" value="<%= @search || "" %>"/>
|
|
||||||
<input type="submit" value="Search" />
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<% if @results.length %>
|
|
||||||
<p>Results for “<%= @search %>”:</p>
|
|
||||||
<ul>
|
|
||||||
<% @results.each do |result| %>
|
|
||||||
<li><strong><%= result[:id] %></strong>: <%= result[:description] %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
|
||||||
|
16
rails/hamster/app/views/solr/simple_query.html.erb
Normal file
16
rails/hamster/app/views/solr/simple_query.html.erb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
<h1>Find Stuff!</h1>
|
||||||
|
|
||||||
|
<form action="" method="get" name="query">
|
||||||
|
<input type="text" name="q" value="<%= @search || "" %>"/>
|
||||||
|
<input type="submit" value="Search" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<% if @results.length %>
|
||||||
|
<p>Results for “<%= @search %>”:</p>
|
||||||
|
<ul>
|
||||||
|
<% @results.each do |result| %>
|
||||||
|
<li><strong><%= result[:id] %></strong>: <%= result[:description] %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
Loading…
Reference in New Issue
Block a user