Class: ParadeDB::SearchMethods::FacetQuery
- Inherits:
-
Object
- Object
- ParadeDB::SearchMethods::FacetQuery
- Defined in:
- lib/parade_db/search_methods.rb
Overview
—- Facet Query helper —-
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(relation:, primary_key:, builder:, fields:, size:, order:, missing:, agg:, exact:, connection:) ⇒ FacetQuery
constructor
A new instance of FacetQuery.
- #sql ⇒ Object
Constructor Details
#initialize(relation:, primary_key:, builder:, fields:, size:, order:, missing:, agg:, exact:, connection:) ⇒ FacetQuery
Returns a new instance of FacetQuery.
923 924 925 926 927 928 929 930 931 932 933 934 935 936 |
# File 'lib/parade_db/search_methods.rb', line 923 def initialize(relation:, primary_key:, builder:, fields:, size:, order:, missing:, agg:, exact:, connection:) @connection = connection @relation = build_relation( relation: relation, primary_key: primary_key, builder: builder, fields: fields, size: size, order: order, missing: missing, agg: agg, exact: exact ) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
906 907 908 |
# File 'lib/parade_db/search_methods.rb', line 906 def connection @connection end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
906 907 908 |
# File 'lib/parade_db/search_methods.rb', line 906 def relation @relation end |
Class Method Details
.build(relation:, primary_key:, builder:, fields:, size:, order:, missing:, agg:, exact:, connection:) ⇒ Object
908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
# File 'lib/parade_db/search_methods.rb', line 908 def self.build(relation:, primary_key:, builder:, fields:, size:, order:, missing:, agg:, exact:, connection:) new( relation: relation, primary_key: primary_key, builder: builder, fields: fields, size: size, order: order, missing: missing, agg: agg, exact: exact, connection: connection ) end |
Instance Method Details
#execute ⇒ Object
942 943 944 |
# File 'lib/parade_db/search_methods.rb', line 942 def execute parse_facets(connection.select_one(sql)) end |
#sql ⇒ Object
938 939 940 |
# File 'lib/parade_db/search_methods.rb', line 938 def sql relation.to_sql end |