module Solr4R::Client::QueryMixin
Public Instance Methods
count( params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 50 def count( params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block) params = params.merge(rows: 0) params[:q] ||= MATCH_ALL_QUERY get(path, params, options, &block) end
json_document(id, params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 66 def json_document(id, params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block) json_query(params.merge(q: { id: id }), options, path, &block).first end
json_query( params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 59 def json_query( params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block) json(path, params.merge(q: query_string(params[:q]), fq: Array( params[:fq]).map(&method(:query_string))), options, &block) end
more_like_this(id, fields, params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block)
Alias for: more_like_this_q
more_like_this_h(id, fields, params = {}, options = {}, path = DEFAULT_MLT_PATH, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 72 def more_like_this_h(id, fields, params = {}, options = {}, path = DEFAULT_MLT_PATH, &block) _more_like_this_query({ id: id }, fields, params, options, path, &block) end
more_like_this_q(id, fields, params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 79 def more_like_this_q(id, fields, params = {}, options = {}, path = DEFAULT_SELECT_PATH, &block) _more_like_this_query(MLT_LOCAL_PARAMS + id, fields, params, options, path, &block) end
Also aliased as: more_like_this
Private Instance Methods
_more_like_this_query(query, fields, params, *args, &block)
click to toggle source
# File lib/solr4r/client/query_mixin.rb, line 90 def _more_like_this_query(query, fields, params, *args, &block) json_query(params.merge('mlt.fl' => Array(fields).join(','), q: query, fl: params.fetch(:fl, MLT_DEFAULT_FL), rows: params.fetch(:rows, MLT_DEFAULT_ROWS)), *args, &block) end