Class: Blur::SimpleQuery

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/active_blur/thrift/blur_types.rb

Constant Summary collapse

QUERYSTR =
1
SUPERQUERYON =
2
TYPE =
3
POSTSUPERFILTER =
4
PRESUPERFILTER =
5
FIELDS =
{
  QUERYSTR => {:type => ::Thrift::Types::STRING, :name => 'queryStr'},
  SUPERQUERYON => {:type => ::Thrift::Types::BOOL, :name => 'superQueryOn', :default => true},
  TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :default =>         0, :enum_class => ::Blur::ScoreType},
  POSTSUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'postSuperFilter'},
  PRESUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'preSuperFilter'}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



263
# File 'lib/active_blur/thrift/blur_types.rb', line 263

def struct_fields; FIELDS; end

#validateObject



265
266
267
268
269
# File 'lib/active_blur/thrift/blur_types.rb', line 265

def validate
  unless @type.nil? || ::Blur::ScoreType::VALID_VALUES.include?(@type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
  end
end