Class: Groonga::Command::Select

Inherits:
Base
  • Object
show all
Defined in:
lib/groonga/command/select.rb

Defined Under Namespace

Classes: Drilldown

Instance Attribute Summary

Attributes inherited from Base

#arguments, #command_name, #original_format, #original_source, #path_prefix

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #[], #[]=, #command_format?, #initialize, #key?, #name, #output_type, #request_id, #to_command_format, #to_uri_format, #uri_format?

Constructor Details

This class inherits a constructor from Groonga::Command::Base

Class Method Details

.command_name ⇒ Object



23
24
25
# File 'lib/groonga/command/select.rb', line 23

def command_name
  "select"
end

.parameter_names ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/groonga/command/select.rb', line 27

def parameter_names
  [
    :table,
    :match_columns,
    :query,
    :filter,
    :scorer,
    :sortby,
    :output_columns,
    :offset,
    :limit,
    :drilldown,
    :drilldown_sortby,
    :drilldown_output_columns,
    :drilldown_offset,
    :drilldown_limit,
    :cache,
    :match_escalation_threshold,
    :query_expansion,
    :query_flags,
    :query_expander,
    :adjuster,
    :drilldown_calc_types,
    :drilldown_calc_target,
    :sort_keys,
    :drilldown_sort_keys,
  ]
end

Instance Method Details

#conditions ⇒ Object



86
87
88
# File 'lib/groonga/command/select.rb', line 86

def conditions
  @conditions ||= split_filter_conditions
end

#drilldown_sort_keys ⇒ ::Array<String>

Returns The sort keys for drilldowns.

Returns:

  • (::Array<String>) —

    The sort keys for drilldowns.

Since:

  • 1.2.8



97
98
99
100
# File 'lib/groonga/command/select.rb', line 97

def drilldown_sort_keys
  value = self[:drilldown_sort_keys] || self[:drilldown_sortby] || ""
  parse_array_value(value)
end

#drilldowns ⇒ Object



90
91
92
# File 'lib/groonga/command/select.rb', line 90

def drilldowns
  @drilldowns ||= array_value(:drilldown)
end

#filter ⇒ Object



82
83
84
# File 'lib/groonga/command/select.rb', line 82

def filter
  self[:filter]
end

#labeled_drilldowns ⇒ ::Hash<String, Drilldown>

Returns The labeled drilldowns.

Returns:

  • (::Hash<String, Drilldown>) —

    The labeled drilldowns.

Since:

  • 1.2.8



105
106
107
# File 'lib/groonga/command/select.rb', line 105

def labeled_drilldowns
  @labeled_drilldowns ||= parse_labeled_drilldowns
end

#output_columns ⇒ Object



109
110
111
# File 'lib/groonga/command/select.rb', line 109

def output_columns
  self[:output_columns]
end

#query ⇒ Object



78
79
80
# File 'lib/groonga/command/select.rb', line 78

def query
  self[:query]
end

#scorer ⇒ Object



74
75
76
# File 'lib/groonga/command/select.rb', line 74

def scorer
  self[:scorer]
end

#sort_keys ⇒ ::Array<String>

Returns The sort keys.

Returns:

  • (::Array<String>) —

    The sort keys.

Since:

  • 1.2.8



70
71
72
# File 'lib/groonga/command/select.rb', line 70

def sort_keys
  parse_array_value(self[:sort_keys] || self[:sortby] || "")
end

#sortby ⇒ String

Deprecated.

since 1.2.8. Use #sort_keys instead.

Returns The sort keys as String. Each key is separated by "," or spaces.

Returns:

  • (String) —

    The sort keys as String. Each key is separated by "," or spaces.



63
64
65
# File 'lib/groonga/command/select.rb', line 63

def sortby
  self[:sortby]
end