outoftime-sunspot 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -29,10 +29,17 @@ objects such as the filesystem.
29
29
 
30
30
  In order to start the packaged Solr installation, run:
31
31
 
32
- sunspot-solr start -- [-d /path/to/data/directory] [-p port]
32
+ sunspot-solr start -- [-d /path/to/data/directory] [-p port] [-s path/to/solr/home]
33
33
 
34
34
  If you don't specify a data directory, your Solr index will be stored in your operating system's temporary directory.
35
35
 
36
+ If you specify a solr home, the directory must contain a <code>conf</code>
37
+ directory, which should contain at least <code>schema.xml</code> and
38
+ <code>solrconfig.xml</code>. Be sure to copy the <code>schema.xml</code> out of
39
+ the Sunspot gem's <code>solr/solr/conf</code> directory. Sunspot relies on the
40
+ field name patterns defined in the packaged <code>schema.xml</code>, so those
41
+ cannot be modified.
42
+
36
43
  You can also run your own instance of Solr wherever you'd like; just copy the solr/config/schema.xml file out of the gem's solr into your installation.
37
44
  You can change the URL at which Sunspot accesses Solr with:
38
45
 
@@ -138,12 +145,13 @@ http://outoftime.lighthouseapp.com/projects/20339-sunspot
138
145
 
139
146
  == Further Reading
140
147
 
141
- Sunspot Discussion: http://groups.google.com/group/ruby-sunspot
142
- Posts about Sunspot from my tumblog: http://outofti.me/tagged/sunspot
148
+ * Sunspot Discussion: http://groups.google.com/group/ruby-sunspot
149
+ * Posts about Sunspot from my tumblog: http://outofti.me/tagged/sunspot
150
+ * Read about it on Linux Magazine: http://www.linux-mag.com/id/7341
143
151
 
144
152
  == Contributors
145
153
 
146
- Mat Brown <mat@patch.com>
154
+ Mat Brown (mat@patch.com)
147
155
 
148
156
  == License
149
157
 
data/TODO CHANGED
@@ -1,4 +1,6 @@
1
1
  === 0.9 ===
2
+ * Instantiated facets!
3
+ * Direct access to adapter
2
4
  * Facet by type (?)
3
5
  * Switch to RSolr
4
6
  * Query-based faceting (?)
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 8
4
- :patch: 1
4
+ :patch: 2
data/bin/sunspot-solr CHANGED
@@ -20,11 +20,16 @@ module SolrFlags extend OptiFlagSet
20
20
  description 'Solr data directory'
21
21
  end
22
22
 
23
+ optional_flag 's' do
24
+ description 'Solr home (should contain conf/ directory)'
25
+ end
26
+
23
27
  and_process!
24
28
  end
25
29
 
26
30
  port = ARGV.flags.p || '8983'
27
31
  data_dir = File.expand_path(ARGV.flags.d || File.join(Dir.tmpdir, 'solr_data'))
32
+ home = File.expand_path(ARGV.flags.s) if ARGV.flags.s
28
33
 
29
34
  Daemons.run_proc('sunspot-solr') do
30
35
  FileUtils.cd(working_directory) do
@@ -32,7 +37,9 @@ Daemons.run_proc('sunspot-solr') do
32
37
  args = ['java']
33
38
  args << "-Djetty.port=#{port}" if port
34
39
  args << "-Dsolr.data.dir=#{data_dir}" if data_dir
40
+ args << "-Dsolr.solr.home=#{home}" if home
35
41
  args << '-jar' << 'start.jar'
42
+ STDERR.puts(args * ' ')
36
43
  Kernel.exec(*args)
37
44
  end
38
45
  end
@@ -13,6 +13,12 @@ describe 'indexer' do
13
13
  session.index post
14
14
  end
15
15
 
16
+ it 'should index text via a virtual field' do
17
+ post :title => 'backwards'
18
+ connection.should_receive(:add).with(hash_including(:backwards_title_text => 'backwards'.reverse))
19
+ session.index(post)
20
+ end
21
+
16
22
  it 'should correctly index a string attribute field' do
17
23
  post :title => 'A Title'
18
24
  connection.should_receive(:add).with(hash_including(:title_s => 'A Title'))
data/spec/mocks/post.rb CHANGED
@@ -47,6 +47,9 @@ end
47
47
 
48
48
  Sunspot.setup(Post) do
49
49
  text :title, :body
50
+ text :backwards_title do
51
+ title.reverse if title
52
+ end
50
53
  string :title
51
54
  integer :blog_id
52
55
  integer :category_ids, :multiple => true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outoftime-sunspot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-26 00:00:00 -07:00
12
+ date: 2009-05-27 00:00:00 -07:00
13
13
  default_executable: sunspot-solr
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency