simple passthrough query version
This commit is contained in:
parent
95591f4484
commit
1699dce6cb
@ -1,5 +1,17 @@
|
||||
require 'open-uri'
|
||||
|
||||
|
||||
class SolrController < ApplicationController
|
||||
$select_url = 'http://localhost:8983/solr/select/'
|
||||
|
||||
def index
|
||||
@search = request[:q]
|
||||
if @search != nil
|
||||
@results = open("#{$select_url}?q=#{@search}&indent=on").read
|
||||
end
|
||||
end
|
||||
|
||||
def browse
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,2 +1,11 @@
|
||||
<h1>Solr#index</h1>
|
||||
<p>Find me in app/views/solr/index.html.erb</p>
|
||||
<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 %>
|
||||
<p>Results for “<%= @search %>”:</p>
|
||||
<pre><%= h(@results) %></pre>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user