Class: JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Regexp
- Inherits:
-
QueryClause
- Object
- QueryClause
- JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Regexp
- Defined in:
- lib/jay_api/elasticsearch/query_builder/query_clauses/regexp.rb
Overview
Represents a Regexp
query in Elasticsearch More information about this type of query can be found here: www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(field:, value:) ⇒ Regexp
constructor
A new instance of Regexp.
-
#to_h ⇒ Hash
The Hash that represents this query (in Elasticsearch’s format).
Constructor Details
#initialize(field:, value:) ⇒ Regexp
Returns a new instance of Regexp.
18 19 20 21 22 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/regexp.rb', line 18 def initialize(field:, value:) super() @field = field @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/regexp.rb', line 13 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/regexp.rb', line 13 def value @value end |
Instance Method Details
#to_h ⇒ Hash
Returns The Hash that represents this query (in Elasticsearch’s format).
26 27 28 29 30 31 32 33 34 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/regexp.rb', line 26 def to_h { regexp: { field => { value: value } } } end |