-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
40 lines (25 loc) · 776 Bytes
/
README
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
solarize
========
A plugin for the Merb framework that enables Solr indexing for DataMapper Models. It is loosely based on the
acts_as_solr plugin(http://acts-as-solr.rubyforge.org/) for rails.
Current Features:
i) Model indexing
ii) Search using get_by_solr
Requirements:
solr-ruby gem
tomcat or jetty running an instance of solr
Usage:
# in config/solr.yml
development:
servlet_path: app_name
port: 8080
host: localhost
# in the model
include Solarize::Resource
solarize :fields => [:id, :title, :body, :author]
# to rebuild indexes in batch
Model.rebuild_solr_index(batch_size)
# to search
Model.get_by_solr('merb hacks')
=> {:total=>2, :docs=>[[113], [112]]}
# that will give you a hash that contains docs array with id's amd total num found