jruby-elasticsearch 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,8 +17,16 @@ class ElasticSearch::Client
17
17
  builder = org.elasticsearch.node.NodeBuilder.nodeBuilder
18
18
  builder.client(true)
19
19
 
20
- if options[:type] == :local
20
+ # The client doesn't need to serve http
21
+ builder.settings.put("http.enabled", false)
22
+
23
+ case options[:type]
24
+ when :local
21
25
  builder.local(true)
26
+ @node = builder.node
27
+ @client = @node.client
28
+ when :transport
29
+ # TODO(sissel): Support transport client
22
30
  else
23
31
  # Use unicast discovery a host is given
24
32
  if !options[:host].nil?
@@ -35,10 +43,10 @@ class ElasticSearch::Client
35
43
  if !options[:cluster].nil?
36
44
  builder.clusterName(options[:cluster])
37
45
  end
46
+ @node = builder.node
47
+ @client = @node.client
38
48
  end
39
49
 
40
- @node = builder.node
41
- @client = @node.client
42
50
  end # def initialize
43
51
 
44
52
  # Index a new document
@@ -2,6 +2,13 @@ require "jruby-elasticsearch/namespace"
2
2
  require "jruby-elasticsearch/request"
3
3
 
4
4
  class ElasticSearch::SearchRequest < ElasticSearch::Request
5
+ begin
6
+ QueryStringQueryBuilder = org.elasticsearch.index.query.xcontent.QueryStringQueryBuilder
7
+ rescue NameError
8
+ # The 'xcontent' namespace was removed in elasticsearch 0.17.0
9
+ QueryStringQueryBuilder = org.elasticsearch.index.query.QueryStringQueryBuilder
10
+ end
11
+
5
12
  # Create a new index request.
6
13
  public
7
14
  def initialize(client)
@@ -62,9 +69,9 @@ class ElasticSearch::SearchRequest < ElasticSearch::Request
62
69
  public
63
70
  def query(query_string, default_operator=:and)
64
71
  # TODO(sissel): allow doing other queries and such.
65
- qbuilder = org.elasticsearch.index.query.xcontent.QueryStringQueryBuilder.new(query_string)
72
+ qbuilder = QueryStringQueryBuilder.new(query_string)
66
73
 
67
- operator = org.elasticsearch.index.query.xcontent.QueryStringQueryBuilder::Operator
74
+ operator = QueryStringQueryBuilder::Operator
68
75
  case default_operator
69
76
  when :and
70
77
  qbuilder.defaultOperator(operator::AND)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease: false
4
+ hash: 11
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
9
+ - 10
10
+ version: 0.0.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-08 00:00:00 -07:00
18
+ date: 2011-07-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -30,14 +30,14 @@ extra_rdoc_files: []
30
30
 
31
31
  files:
32
32
  - lib/jruby-elasticsearch.rb
33
- - lib/jruby-elasticsearch/request.rb
33
+ - lib/jruby-elasticsearch/bulkstream.rb
34
+ - lib/jruby-elasticsearch/bulkrequest.rb
35
+ - lib/jruby-elasticsearch/actionlistener.rb
34
36
  - lib/jruby-elasticsearch/searchrequest.rb
35
37
  - lib/jruby-elasticsearch/indexrequest.rb
36
- - lib/jruby-elasticsearch/actionlistener.rb
37
- - lib/jruby-elasticsearch/bulkrequest.rb
38
+ - lib/jruby-elasticsearch/request.rb
38
39
  - lib/jruby-elasticsearch/namespace.rb
39
40
  - lib/jruby-elasticsearch/client.rb
40
- - lib/jruby-elasticsearch/bulkstream.rb
41
41
  has_rdoc: true
42
42
  homepage: https://github.com/jordansissel/jruby-elasticsearch
43
43
  licenses:
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements: []
70
70
 
71
71
  rubyforge_project:
72
- rubygems_version: 1.3.7
72
+ rubygems_version: 1.6.2
73
73
  signing_key:
74
74
  specification_version: 3
75
75
  summary: JRuby API for ElasticSearch using the native ES Java API