-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
113 lines (104 loc) · 4.49 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
title: "Sunspot: Solr-powered search for Ruby objects"
---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Sunspot: Solr-powered search for Ruby objects</title>
<link rel="stylesheet" type="text/css" href="main.css"/>
<link rel="stylesheet" type="text/css" href="ruby.css"/>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27303446-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="main">
<a href="http://github.com/sunspot/sunspot">
<img src="forkme.png" class="forkme"/>
</a>
<div id="content">
<h1>Sunspot</h1>
<h4>Solr-powered search for Ruby objects</h4>
<p>
All the power of the <a href="http://lucene.apache.org/solr/">Solr</a>
search engine; all the beauty of Ruby.
<a href="http://github.com/sunspot/sunspot">Sunspot</a> exposes all
of Solr's most powerful search features using an API of elegant DSLs.
That means robust, flexible fulltext search with no boolean queries
and no string programming.
</p>
<h3>Index your objects.</h3>
{% highlight ruby %}
class Post < ActiveRecord::Base
searchable do
text :title, :body
text :comments do
comments.map { |comment| comment.body }
end
integer :blog_id
integer :author_id
integer :category_ids, :multiple => true
time :published_at
string :sort_title do
title.downcase.gsub(/^(an?|the)\b/, '')
end
end
end
{% endhighlight %}
<h3>Search for them.</h3>
{% highlight ruby %}
Post.search do
fulltext 'best pizza'
with :blog_id, 1
with(:published_at).less_than Time.now
order_by :published_at, :desc
paginate :page => 2, :per_page => 15
facet :category_ids, :author_id
end
{% endhighlight %}
<h3>Use it with or without Rails.</h3>
<p>
The <strong>sunspot_rails</strong> gem integrates Sunspot into
Rails with drop-in ease, extending ActiveRecord objects for
searchability and managing the commit cycle transparently.
<strong>sunspot_rails</strong> works with Rails 2.3 and Rails
3.0. See the <a href="https://github.com/sunspot/sunspot/blob/master/README.md">
Quickstart with Rails 3</a> in the README to get started.
</p>
<p>
If you're not using Rails, or you're using Rails without ActiveRecord,
the core Sunspot library can be hooked into your persistence layer with
<a href="https://github.com/jugyo/sunspot_mongoid/blob/master/lib/sunspot/mongoid.rb">
just a few lines of code</a>.
</p>
<h3>Get started.</h3>
<p>
Start with the <a href="https://github.com/sunspot/sunspot#readme">README</a>.<br/>
Learn more on the <a href="http://wiki.github.com/sunspot/sunspot">Wiki</a>.<br/>
Consult the <a href="docs/index.html">API documentation</a> for a detailed reference.<br/>
Ask questions on the <a href="http://groups.google.com/group/ruby-sunspot">Google Group</a>.<br/>
Chat about it on <a href="irc://chat.freenode.net/%23sunspot-ruby">IRC #sunspot-ruby @ freenode</a>.<br/>
Give it a shout out on <a href="https://www.ruby-toolbox.com/projects/sunspot">Ruby Toolbox</a>.<br/>
Follow announcements on Twitter at <a href="https://twitter.com/sunspot_ruby">@sunspot_ruby</a>.
</p>
<h3>Contribute.</h3>
<p>
Browse the <a href="http://github.com/sunspot/sunspot">source</a>.<br/>
Report bugs on <a href="http://github.com/sunspot/sunspot/issues"> GitHub Issues</a>.<br/>
Propose new features on the <a href="http://groups.google.com/group/ruby-sunspot">Google Group</a>.<br/>
Submit a pull request on <a href="http://github.com/sunspot/sunspot">GitHub</a>.<br/>
<br/>
<a href="https://github.com/sunspot/sunspot"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
</p>
</div>
</div>
</body>
</html>