Class: Groonga::Command::Select

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

Defined Under Namespace

Classes: Drilldown, Slice

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_nameObject



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

def command_name
  "select"
end

.parameter_namesObject



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
55
# File 'lib/groonga/command/select.rb', line 28

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

#conditionsObject



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

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



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

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

#drilldownsObject



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

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

#filterObject



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

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



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

def labeled_drilldowns
  @labeled_drilldowns ||= parse_labeled_drilldowns
end

#output_columnsObject



117
118
119
# File 'lib/groonga/command/select.rb', line 117

def output_columns
  self[:output_columns]
end

#queryObject



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

def query
  self[:query]
end

#scorerObject



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

def scorer
  self[:scorer]
end

#slices::Hash<String, Slice>

Returns The slices.

Returns:

  • (::Hash<String, Slice>)

    The slices.

Since:

  • 1.3.0



113
114
115
# File 'lib/groonga/command/select.rb', line 113

def slices
  @slices ||= parse_slices
end

#sort_keys::Array<String>

Returns The sort keys.

Returns:

  • (::Array<String>)

    The sort keys.

Since:

  • 1.2.8



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

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

#sortbyString

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.



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

def sortby
  self[:sortby]
end