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
56
# 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,
    :drilldown_filter,
    :sort_keys,
    :drilldown_sort_keys,
  ]
end

Instance Method Details

#conditionsObject



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

def conditions
  @conditions ||= split_filter_conditions
end

#drilldown_filterString?

Returns The filter for the drilled down result.

Returns:

  • (String, nil)

    The filter for the drilled down result.

Since:

  • 1.3.3



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

def drilldown_filter
  self[:drilldown_filter]
end

#drilldown_sort_keys::Array<String>

Returns The sort keys for drilldowns.

Returns:

  • (::Array<String>)

    The sort keys for drilldowns.

Since:

  • 1.2.8



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

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

#drilldownsObject



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

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

#filterObject



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

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



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

def labeled_drilldowns
  @labeled_drilldowns ||= parse_labeled_drilldowns
end

#output_columnsObject

TODO: We should return ::Array instead of raw output_columns value. But it breaks backward compatibility...



128
129
130
# File 'lib/groonga/command/select.rb', line 128

def output_columns
  self[:output_columns]
end

#queryObject



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

def query
  self[:query]
end

#scorerObject



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

def scorer
  self[:scorer]
end

#slices::Hash<String, Slice>

Returns The slices.

Returns:

  • (::Hash<String, Slice>)

    The slices.

Since:

  • 1.3.0



121
122
123
# File 'lib/groonga/command/select.rb', line 121

def slices
  @slices ||= parse_slices
end

#sort_keys::Array<String>

Returns The sort keys.

Returns:

  • (::Array<String>)

    The sort keys.

Since:

  • 1.2.8



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

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.



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

def sortby
  self[:sortby]
end