Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for partial_fields

  • Loading branch information...
commit 583201aec86b1458543ed824bee0772b80694f4a 1 parent 5129f8a
@simonjsmithuk simonjsmithuk authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/tire/search.rb
View
9 lib/tire/search.rb
@@ -116,6 +116,14 @@ def version(value)
self
end
+ def partial_fields(name, include_fields, exclude_fields =[])
+ @partial_fields ||= {}
+ @partial_fields[name] = {}
+ @partial_fields[name]['include'] = include_fields unless include_fields.empty?
+ @partial_fields[name]['exclude'] = exclude_fields unless exclude_fields.empty?
+ self
+ end
+
def perform
@response = Configuration.client.get(self.url + self.params, self.to_json)
if @response.failure?
@@ -149,6 +157,7 @@ def to_hash
request.update( { :script_fields => @script_fields } ) if @script_fields
request.update( { :version => @version } ) if @version
request.update( { :explain => @explain } ) if @explain
+ request.update( { :partial_fields => @partial_fields} ) if @partial_fields
request
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.