picker

package module
v0.0.0-...-4f3e710 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

picker

picker is composed of types for Elasticsearch 7. For now, the purpose is to have strongly typed mappings, fields, and analyzers that can be marshaled and unmarshaled, to be used with the official Elasticsearch go client.

Aggregations are currently a map[string]interface{}. There are ~70 aggregations and its sort of an all-or-nothing. I plan to get to them all but this is incredibly tedious and time consuming.

s, err := picker.NewSearch(picker.SearchParams{
    	Query: &picker.QueryParams{
    		Intervals: picker.IntervalsQueryParams{
    			Field: "my_text",
    			Rule: picker.AllOfRuleParams{
    				Ordered: true,
    				Intervals: picker.Ruleset{
    					picker.MatchRuleParams{
    						Query:   "my favorite food",
    						MaxGaps: 0,
    						Ordered: true,
    					},
    					picker.AnyOfRuleParams{
    						Intervals: picker.Ruleset{
    							picker.MatchRuleParams{Query: "brisket"},
    							picker.MatchRuleParams{Query: "kimchy fries"},
    						},
    					},
    				},
    			},
    		},
    	},
})
_ = err
data, _ := json.MarshalIndent(s, "", "  ")
fmt.Println(string(data))

Produces:

{
  "query": {
    "intervals": {
      "my_text": {
        "all_of": {
          "intervals": [
            {
              "match": {
                "query": "my favorite food",
                "max_gaps": 0,
                "ordered": true
              }
            },
            {
              "any_of": {
                "intervals": [
                  {
                    "match": {
                      "query": "brisket"
                    }
                  },
                  {
                    "match": {
                      "query": "kimchy fries"
                    }
                  }
                ]
              }
            }
          ],
          "ordered": true
        }
      }
    }
  }
}

picker will unmarshal shorthand queries (like { "term": {"my_field": "my_string" } }) but always marshals into long-form ({"term":{"my_field": {"value": "my_string" } } })

Todo

Testing is incredibly sparse at the moment. I'm merely using this list to keep track of which structures are theoretically complete. It does not indicate the doneness of the items as testing is undoubtly lacking.

Field Mappings
Common types
  • Binary
    Binary value encoded as a Base64 string.
  • Boolean
    true and false values.
  • Keyword
    used for structured content such as IDs, email addresses, hostnames, status codes, zip codes, or tags.
  • Constant keyword [X-Pack]
    Constant keyword is a specialization of the keyword field for the case that all documents in the index have the same value.
  • Wildcard [X-Pack]
    The wildcard field type is a specialized keyword field for unstructured machine-generated content you plan to search using grep-like wildcard and regexp queries. The wildcard type is optimized for fields with large values or high cardinality.
  • Long
    Long is a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.
  • Integer
    Integer is a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.
  • Byte
    Byte is a signed 8-bit integer with a minimum value of -128 and a maximum value of 127.
  • Float
    Float is a single-precision 32-bit IEEE 754 floating point number, restricted to finite values.
  • Double
    Double is a double-precision 64-bit IEEE 754 floating point number, restricted to finite values.
  • Short
    Short is signed 16-bit integer with a minimum value of -32,768 and a maximum value of 32,767.
  • HalfFloat
    HalfFloat is a half-precision 16-bit IEEE 754 floating point number, restricted to finite values.
  • UnsignedLong
    UnsignedLongFieldParams are params for an UnsignedLongField which is an unsigned 64-bit integer with a minimum value of 0 and a maximum value of 264-1.
  • ScaledFloat
    Numeric types, such as long and double, used to express amounts.
  • Date
    Date field type
  • Date nanoseconds
    Date nanoseconds field type
  • Alias
    Defines an alias for an existing field.
Objects and relational types
  • Object
    A JSON object.
  • Flattened
    An entire JSON object as a single field value.
  • Nested
    A JSON object that preserves the relationship between its subfields.
  • Join
    Defines a parent/child relationship for documents in the same index.
Structured data types
  • Long range
    LongRangeField is a range of signed 64-bit integers with a minimum value of -263 and maximum of 263-1.
  • Integer range
    Range types, such as long_range, double_range, date_range, and ip_range.
  • Float range
    FloatRangeField is a range of single-precision 32-bit IEEE 754 floating point values.
  • Double range
    Range types, such as long_range, double_range, date_range, and ip_range.
  • Date range
    DateRangeField is a range of date values. Date ranges support various date formats through the format mapping parameter. Regardless of the format used, date values are parsed into an unsigned 64-bit integer representing milliseconds since the Unix epoch in UTC. Values containing the now date math expression are not supported
  • IP range
    IPRangeField is a range of ip values supporting either IPv4 or IPv6 (or mixed) addresses.
  • IP
    IPv4 and IPv6 addresses.
  • Version [X-Pack]
    Software versions. Supports Semantic Versioning precedence rules.
  • Murmur3 [Plugin]
    Compute and stores hashes of values.
Aggregate data types
Text search types
Document ranking types
  • Dense vector [X-Pack]
    Records dense vectors of float values.
  • Sparse vector [X-Pack] [Deprecated]
    Records sparse vectors of float values.
  • Rank feature
    Records a numeric feature to boost hits at query time.
  • Rank features
    Records numeric features to boost hits at query time.
Spatial data types
  • Geo point
    Latitude and longitude points.
  • Geo shape
    Complex shapes, such as polygons.
  • Point
    Arbitrary cartesian points.
  • Shape
    Arbitrary cartesian geometries.
Other types
  • Percolator
    Indexes queries written in Query DSL.
Queries
Compound queries

Compound queries wrap other compound or leaf queries, either to combine their results and scores, to change their behaviour, or to switch from query to filter context.

  • Boolean
    The default query for combining multiple leaf or compound query clauses, as must, should, must_not, or filter clauses. The must and should clauses have their scores combined — the more matching clauses, the better — while the must_not and filter clauses are executed in filter context.
  • Boosting
    Return documents which match a positive query, but reduce the score of documents which also match a negative query.
  • Constant score
    A query which wraps another query, but executes it in filter context. All matching documents are given the same “constant” _score.
  • Disjunction max
    A query which accepts multiple queries, and returns any documents which match any of the query clauses. While the bool query combines the scores from all matching queries, the dis_max query uses the score of the single best- matching query clause.
  • Function score
    Modify the scores returned by the main query with functions to take into account factors like popularity, recency, distance, or custom algorithms implemented with scripting.
Fulltext queries

The full text queries enable you to search analyzed text fields such as the body of an email. The query string is processed using the same analyzer that was applied to the field during indexing.

  • Intervals
    A full text query that allows fine-grained control of the ordering and proximity of matching terms.
  • Match
    The standard query for performing full text queries, including fuzzy matching and phrase or proximity queries.
  • Match bool prefix
    Creates a bool query that matches each term as a term query, except for the last term, which is matched as a prefix query
  • Match phrase
    Like the match query but used for matching exact phrases or word proximity matches.
  • Match phrase prefix
    Like the match_phrase query, but does a wildcard search on the final word.
  • Multi-match
    The multi-field version of the match query.
  • Common Terms [Deprecated]
    A more specialized query which gives more preference to uncommon words.
  • Query string
    Supports the compact Lucene query string syntax, allowing you to specify AND|OR|NOT conditions and multi-field search within a single query string. For expert users only.
  • Simple query string
    A simpler, more robust version of the query_string syntax suitable for exposing directly to users.
Geo queries

Elasticsearch supports two types of geo data: geo_point fields which support lat/lon pairs, and geo_shape fields, which support points, lines, circles, polygons, multi-polygons, etc.

  • Geo bounding box
    Finds documents with geo-points that fall into the specified rectangle.
  • Geo distance
    Finds documents with geo-points within the specified distance of a central point.
  • Geo polygon [Deprecated]
    Find documents with geo-points within the specified polygon.
  • Geo shape
    • geo-shapes which either intersect, are contained by, or do not intersect with the specified geo-shape
    • geo-points which intersect the specified geo-shape
Shape queries [X-Pack]

Like geo_shape Elasticsearch supports the ability to index arbitrary two dimension (non Geospatial) geometries making it possible to map out virtual worlds, sporting venues, theme parks, and CAD diagrams. Elasticsearch supports two types of cartesian data: point fields which support x/y pairs, and shape fields, which support points, lines, circles, polygons, multi-polygons, etc.

  • Shape
    • shapes which either intersect, are contained by, are within or do not intersect with the specified shape
    • points which intersect the specified shape
Joining queries
  • Nested
    Documents may contain fields of type nested. These fields are used to index arrays of objects, where each object can be queried (with the nested query) as an independent document.
  • Has child
    A join field relationship can exist between documents within a single index. The has_child query returns parent documents whose child documents match the specified query, while the has_parent query returns child documents whose parent document matches the specified query.
  • Has parent
    Returns child documents whose joined parent document matches a provided query. You can create parent-child relationships between documents in the same index using a join field mapping.
  • Parent ID
    Returns child documents joined to a specific parent document. You can use a join field mapping to create parent-child relationships between documents in the same index.
  • Match all
    The most simple query, which matches all documents, giving them all a _score of 1.0.
  • Match none
    This is the inverse of the match_all query, which matches no documents.
Specialized queries
  • Distance feature
    A query that computes scores based on the dynamically computed distances between the origin and documents' date, date_nanos and geo_point fields. It is able to efficiently skip non-competitive hits.
  • More like this
    This query finds documents which are similar to the specified text, document, or collection of documents.
  • Percolate
    This query finds queries that are stored as documents that match with the specified document.
  • Rank feature
    A query that computes scores based on the values of numeric features and is able to efficiently skip non-competitive hits.
  • Script
    This query allows a script to act as a filter. Also see the function_score query.
  • Script score
    A query that allows to modify the score of a sub-query with a script.
  • Wrapper
    A query that accepts other queries as json or yaml string.
  • Pinned [X-Pack]
    A query that promotes selected documents over others matching a given query.
Term-level queries

You can use term-level queries to find documents based on precise values in structured data. Examples of structured data include date ranges, IP addresses, prices, or product IDs. Unlike full-text queries, term-level queries do not analyze search terms. Instead, term-level queries match the exact terms stored in a field.

  • Exists
    Returns documents that contain any indexed value for a field.
  • Fuzzy
    Returns documents that contain terms similar to the search term. Elasticsearch measures similarity, or fuzziness, using a Levenshtein edit distance.
  • IDs
    Returns documents based on their document IDs.
  • Prefix
    Returns documents that contain a specific prefix in a provided field.
  • Range
    Returns documents that contain terms within a provided range.
  • Regexp
    Returns documents that contain terms matching a regular expression.
  • Term
    Returns documents that contain an exact term in a provided field.
  • Terms
    Returns documents that contain one or more exact terms in a provided field.
  • Terms set
    Returns documents that contain a minimum number of exact terms in a provided field. You can define the minimum number of matching terms using a field or script.
  • Type [Deprecated]
    Returns documents of the specified type.
  • Wildcard
    Returns documents that contain terms matching a wildcard pattern.
Span queries

Span queries are low-level positional queries which provide expert control over the order and proximity of the specified terms. These are typically used to implement very specific queries on legal documents or patents.

It is only allowed to set boost on an outer span query. Compound span queries, like span_near, only use the list of matching spans of inner span queries in order to find their own spans, which they then use to produce a score. Scores are never computed on inner span queries, which is the reason why boosts are not allowed: they only influence the way scores are computed, not spans.

Span queries cannot be mixed with non-span queries (with the exception of the span_multi query).

  • Span containing
    Accepts a list of span queries, but only returns those spans which also match a second span query.
  • Field masking span
    Allows queries like span-near or span-or across different fields.
  • Span first
    Accepts another span query whose matches must appear within the first N positions of the field.
  • Span multi
    Wraps a term, range, prefix, wildcard, regexp, or fuzzy query.
  • Span near
    Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order.
  • Span not
    Wraps another span query, and excludes any documents which match that query.
  • Span or
    Combines multiple span queries — returns documents which match any of the specified queries.
  • Span term
    The equivalent of the term query but for use with other span queries.
  • Span within
    The result from a single span query is returned as long is its span falls within the spans returned by a list of other span queries.
Pipeline Processors
  • Append
    Appends one or more values to an existing array if the field already exists and it is an array. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist. Accepts a single value or an array of values.
  • Bytes
    Converts a human readable byte value (e.g. 1kb) to its value in bytes (e.g. 1024). If the field is an array of strings, all members of the array will be converted.
  • Circle [X-Pack]
    Converts circle definitions of shapes to regular polygons which approximate them.
  • Community ID [X-Pack]
    Computes the Community ID for network flow data as defined in the Community ID Specification. You can use a community ID to correlate network events related to a single flow.
  • Convert
    Converts a field in the currently ingested document to a different type, such as converting a string to an integer. If the field value is an array, all members will be converted.
    The supported types include: integer, long, float, double, string, boolean, and auto.
    Specifying boolean will set the field to true if its string value is equal to true (ignore case), to false if its string value is equal to false (ignore case), or it will throw an exception otherwise.
  • CSV
    Extracts fields from CSV line out of a single text field within a document. Any empty field in CSV will be skipped.
  • Date
    Parses dates from fields, and then uses the date or timestamp as the timestamp for the document. By default, the date processor adds the parsed date as a new field called @timestamp. You can specify a different field by setting the target_field configuration parameter. Multiple date formats are supported as part of the same date processor definition. They will be used sequentially to attempt parsing the date field, in the same order they were defined as part of the processor definition.
  • Date Index Name
    The purpose of this processor is to point documents to the right time based index based on a date or timestamp field in a document by using the date math index name support.
    The processor sets the _index metadata field with a date math index name expression based on the provided index name prefix, a date or timestamp field in the documents being processed and the provided date rounding.
  • Dissect
    Similar to the Grok Processor, dissect also extracts structured fields out of a single text field within a document. However unlike the Grok Processor, dissect does not use Regular Expressions. This allows dissect’s syntax to be simple and for some cases faster than the Grok Processor.
    Dissect matches a single text field against a defined pattern.
  • DotExpander
    Expands a field with dots into an object field. This processor allows fields with dots in the name to be accessible by other processors in the pipeline. Otherwise these fields can’t be accessed by any processor.
  • Drop
    Drops the document without raising any errors. This is useful to prevent the document from getting indexed based on some condition.
  • Enrich [X-Pack]
    The enrich processor can enrich documents with data from another index. See enrich data section for more information about how to set this up.
  • Fail
    Raises an exception. This is useful for when you expect a pipeline to fail and want to relay a specific message to the requester.
  • Fingerprint [X-Pack]
    Computes a hash of the document’s content. You can use this hash for content fingerprinting.
  • Foreach
    Processes elements in an array of unknown length.
  • GeoIP
    The geoip processor adds information about the geographical location of IP addresses, based on data from the Maxmind databases. This processor adds this information by default under the geoip field. The geoip processor can resolve both IPv4 and IPv6 addresses.
  • Grok
    Extracts structured fields out of a single text field within a document. You choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused.
  • Gsub
    Converts a string field by applying a regular expression and a replacement. If the field is an array of string, all members of the array will be converted. If any non-string values are encountered, the processor will throw an exception.
  • HTML Strip
    Removes HTML tags from the field. If the field is an array of strings, HTML tags will be removed from all members of the array.
  • Inference [X-Pack]
    Uses a pre-trained data frame analytics model to infer against the data that is being ingested in the pipeline.
  • Join
    Joins each element of an array into a single string using a separator character between each element. Throws an error when the field is not an array.
  • JSON
    Converts a JSON string into a structured JSON object.
  • KV
    This processor helps automatically parse messages (or specific event fields) which are of the foo=bar variety.
  • Lowercase
    Converts a string to its lowercase equivalent. If the field is an array of strings, all members of the array will be converted.
  • NetworkDirection [X-Pack]
    Calculates the network direction given a source IP address, destination IP address, and a list of internal networks.
  • Pipeline
    Executes another pipeline.
  • Remove
    Removes existing fields. If one field doesn’t exist, an exception will be thrown.
  • Rename
    Renames an existing field. If the field doesn’t exist or the new name is already used, an exception will be thrown.
  • Script
    Allows inline and stored scripts to be executed within ingest pipelines.
  • Set
    Sets one field and associates it with the specified value. If the field already exists, its value will be replaced with the provided one.
  • Set Security User
    Sets user-related details (such as username, roles, email, full_name, metadata, api_key, realm and authentication_type) from the current authenticated user to the current document by pre-processing the ingest. The api_key property exists only if the user authenticates with an API key. It is an object containing the id and name fields of the API key. The realm property is also an object with two fields, name and type. When using API key authentication, the realm property refers to the realm from which the API key is created. The authentication_type property is a string that can take value from REALM, API_KEY, TOKEN and ANONYMOUS.
  • Sort
    Sorts the elements of an array ascending or descending. Homogeneous arrays of numbers will be sorted numerically, while arrays of strings or heterogeneous arrays of strings + numbers will be sorted lexicographically. Throws an error when the field is not an array.
  • Split
    Splits a field into an array using a separator character. Only works on string fields.
  • Trim
    Trims whitespace from field. If the field is an array of strings, all members of the array will be trimmed.
  • Uppercase
    Converts a string to its uppercase equivalent. If the field is an array of strings, all members of the array will be converted.
  • URL Decode
    URL-decodes a string. If the field is an array of strings, all members of the array will be decoded.
  • URI Parts [X-Pack]
    Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password.
  • User Agent
    The user_agent processor extracts details from the user agent string a browser sends with its web requests. This processor adds this information by default under the user_agent field.
Aggregations

An aggregation summarizes your data as metrics, statistics, or other analytics.

Bucket aggregations

Bucket aggregations don’t calculate metrics over fields like the metrics aggregations do, but instead, they create buckets of documents. Each bucket is associated with a criterion (depending on the aggregation type) which determines whether or not a document in the current context "falls" into it. In other words, the buckets effectively define document sets. In addition to the buckets themselves, the bucket aggregations also compute and return the number of documents that "fell into" each bucket.

Bucket aggregations, as opposed to metrics aggregations, can hold sub-aggregations. These sub-aggregations will be aggregated for the buckets created by their "parent" bucket aggregation.

There are different bucket aggregators, each with a different "bucketing" strategy. Some define a single bucket, some define fixed number of multiple buckets, and others dynamically create the buckets during the aggregation process.

  • Adjacency matrix
    A bucket aggregation returning a form of adjacency matrix. The request provides a collection of named filter expressions, similar to the filters aggregation request. Each bucket in the response represents a non-empty cell in the matrix of intersecting filters.
  • Auto-interval date histogram
    A multi-bucket aggregation similar to the Date histogram except instead of providing an interval to use as the width of each bucket, a target number of buckets is provided indicating the number of buckets needed and the interval of the buckets is automatically chosen to best achieve that target. The number of buckets returned will always be less than or equal to this target number.
  • Children
    A special single bucket aggregation that selects child documents that have the specified type, as defined in a join field.
  • Composite
    A multi-bucket aggregation that creates composite buckets from different sources.
    Unlike the other multi-bucket aggregations, you can use the composite aggregation to paginate all buckets from a multi-level aggregation efficiently. This aggregation provides a way to stream all buckets of a specific aggregation, similar to what scroll does for documents.
    The composite buckets are built from the combinations of the values extracted/created for each document and each combination is considered as a composite bucket.
  • Date histogram
    This multi-bucket aggregation is similar to the normal histogram, but it can only be used with date or date range values. Because dates are represented internally in Elasticsearch as long values, it is possible, but not as accurate, to use the normal histogram on dates as well. The main difference in the two APIs is that here the interval can be specified using date/time expressions. Time-based data requires special support because time-based intervals are not always a fixed length.
  • Date range
    A range aggregation that is dedicated for date values. The main difference between this aggregation and the normal range aggregation is that the from and to values can be expressed in Date Math expressions, and it is also possible to specify a date format by which the from and to response fields will be returned. Note that this aggregation includes the from value and excludes the to value for each range.
  • Diversified sampler
    Like the sampler aggregation this is a filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents. The diversified_sampler aggregation adds the ability to limit the number of matches that share a common value such as an "author".
  • Filter
    Defines a single bucket of all the documents in the current document set context that match a specified filter. Often this will be used to narrow down the current aggregation context to a specific set of documents.
  • Filters
    Defines a multi bucket aggregation where each bucket is associated with a filter. Each bucket will collect all documents that match its associated filter.
  • Geo-distance
    A multi-bucket aggregation that works on geo_point fields and conceptually works very similar to the range aggregation. The user can define a point of origin and a set of distance range buckets. The aggregation evaluate the distance of each document value from the origin point and determines the buckets it belongs to based on the ranges (a document belongs to a bucket if the distance between the document and the origin falls within the distance range of the bucket).
  • Geohash grid
    A multi-bucket aggregation that groups geo_point and geo_shape values into buckets that represent a grid. The resulting grid can be sparse and only contains cells that have matching data. Each cell is labeled using a geohash which is of user-definable precision.
  • Geotile grid
    A multi-bucket aggregation that groups geo_point and geo_shape values into buckets that represent a grid. The resulting grid can be sparse and only contains cells that have matching data. Each cell corresponds to a map tile as used by many online map sites. Each cell is labeled using a "{zoom}/{x}/{y}" format, where zoom is equal to the user-specified precision.
  • Global
    Defines a single bucket of all the documents within the search execution context. This context is defined by the indices and the document types you’re searching on, but is not influenced by the search query itself.
  • Histogram
    A multi-bucket values source based aggregation that can be applied on numeric values or numeric range values extracted from the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values.
  • IP range
    Just like the dedicated date range aggregation, there is also a dedicated range aggregation for IP typed fields
  • Missing
    A field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set). This aggregator will often be used in conjunction with other field data bucket aggregators (such as ranges) to return information for all the documents that could not be placed in any of the other buckets due to missing field data values.
  • Multi Terms [X-Pack]
    A multi-bucket value source based aggregation where buckets are dynamically built - one per unique set of values. The multi terms aggregation is very similar to the terms aggregation, however in most cases it will be slower than the terms aggregation and will consume more memory. Therefore, if the same set of fields is constantly used, it would be more efficient to index a combined key for this fields as a separate field and use the terms aggregation on this field.
  • Nested
    A special single bucket aggregation that enables aggregating nested documents.
  • Parent
    A special single bucket aggregation that selects parent documents that have the specified type, as defined in a join field.
  • Range
    A multi-bucket value source based aggregation that enables the user to define a set of ranges - each representing a bucket. During the aggregation process, the values extracted from each document will be checked against each bucket range and "bucket" the relevant/matching document. Note that this aggregation includes the from value and excludes the to value for each range.
  • Rare terms
    A multi-bucket value source based aggregation which finds "rare" terms — terms that are at the long-tail of the distribution and are not frequent. Conceptually, this is like a terms aggregation that is sorted by _count ascending. As noted in the terms aggregation docs, actually ordering a terms agg by count ascending has unbounded error. Instead, you should use the rare_terms aggregation
  • Reverse nested
    A special single bucket aggregation that enables aggregating on parent docs from nested documents. Effectively this aggregation can break out of the nested block structure and link to other nested structures or the root document, which allows nesting other aggregations that aren’t part of the nested object in a nested aggregation.
  • Sampler
    A filtering aggregation used to limit any sub aggregations' processing to a sample of the top-scoring documents.
  • Significant terms
    An aggregation that returns interesting or unusual occurrences of terms in a set.
  • Significant text
    An aggregation that returns interesting or unusual occurrences of free-text terms in a set.
  • Terms
    A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value.
  • Variable width histogram
    This is a multi-bucket aggregation similar to Histogram. However, the width of each bucket is not specified. Rather, a target number of buckets is provided and bucket intervals are dynamically determined based on the document distribution. This is done using a simple one-pass document clustering algorithm that aims to obtain low distances between bucket centroids. Unlike other multi-bucket aggregations, the intervals will not necessarily have a uniform width.
Metric aggreations

The aggregations in this family compute metrics based on values extracted in one way or another from the documents that are being aggregated. The values are typically extracted from the fields of the document (using the field data), but can also be generated using scripts.

Numeric metrics aggregations are a special type of metrics aggregation which output numeric values. Some aggregations output a single numeric metric (e.g. avg) and are called single-value numeric metrics aggregation, others generate multiple metrics (e.g. stats) and are called multi-value numeric metrics aggregation. The distinction between single-value and multi-value numeric metrics aggregations plays a role when these aggregations serve as direct sub-aggregations of some bucket aggregations (some bucket aggregations enable you to sort the returned buckets based on the numeric metrics in each bucket).

  • Avg
    A single-value metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
  • Boxplot [X-Pack]
    A boxplot metrics aggregation that computes boxplot of numeric values extracted from the aggregated documents. These values can be generated by a provided script or extracted from specific numeric or histogram fields in the documents.
  • Cardinality
    A single-value metrics aggregation that calculates an approximate count of distinct values. Values can be extracted either from specific fields in the document or generated by a script.
  • Extended stats
    A multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
    The extended_stats aggregations is an extended version of the stats aggregation, where additional metrics are added such as sum_of_squares, variance, std_deviation and std_deviation_bounds.
  • Geo-bounds
    A metric aggregation that computes the bounding box containing all geo values for a field.
  • Geo-centroid
    metric aggregation that computes the weighted centroid from all coordinate values for geo fields.
  • Geo-Line [X-Pack]
    The geo_line aggregation aggregates all geo_point values within a bucket into a LineString ordered by the chosen sort field. This sort can be a date field, for example. The bucket returned is a valid GeoJSON Feature representing the line geometry.
  • Matrix stats
    The matrix_stats aggregation is a numeric aggregation that computes the following statistics over a set of document fields
  • Max
    A single-value metrics aggregation that keeps track and returns the maximum value among the numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
  • Median absolute deviation
    This single-value aggregation approximates the median absolute deviation of its search results.
    Median absolute deviation is a measure of variability. It is a robust statistic, meaning that it is useful for describing data that may have outliers, or may not be normally distributed. For such data it can be more descriptive than standard deviation.
  • Min
    single-value metrics aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
  • Percentile ranks
    A multi-value metrics aggregation that calculates one or more percentile ranks over numeric values extracted from the aggregated documents. These values can be generated by a provided script or extracted from specific numeric or histogram fields in the documents.
  • Percentiles
    A multi-value metrics aggregation that calculates one or more percentiles over numeric values extracted from the aggregated documents. These values can be generated by a provided script or extracted from specific numeric or histogram fields in the documents.
  • Rate [X-Pack]
    A rate metrics aggregation can be used only inside a date_histogram and calculates a rate of documents or a field in each date_histogram bucket. The field values can be generated by a provided script or extracted from specific numeric or histogram fields in the documents.
  • Scripted metric
    A metric aggregation that executes using scripts to provide a metric output.
  • Stats
    A multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
    The stats that are returned consist of: min, max, sum, count and avg.
  • String stats [X-Pack]
    A multi-value metrics aggregation that computes statistics over string values extracted from the aggregated documents. These values can be retrieved either from specific keyword fields in the documents or can be generated by a provided script.
  • Sum
    A single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric or histogram fields in the documents, or be generated by a provided script.
  • T-test [X-Pack]
    A t_test metrics aggregation that performs a statistical hypothesis test in which the test statistic follows a Student’s t-distribution under the null hypothesis on numeric values extracted from the aggregated documents or generated by provided scripts. In practice, this will tell you if the difference between two population means are statistically significant and did not occur by chance alone.
  • Top hits
    A top_hits metric aggregator keeps track of the most relevant document being aggregated. This aggregator is intended to be used as a sub aggregator, so that the top matching documents can be aggregated per bucket.
  • Top metrics [X-Pack]
    The top_metrics aggregation selects metrics from the document with the largest or smallest "sort" value.
  • Value count
    A single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents. These values can be extracted either from specific fields in the documents, or be generated by a provided script. Typically, this aggregator will be used in conjunction with other single-value aggregations. For example, when computing the avg one might be interested in the number of values the average is computed over.
  • Weighted avg
    A single-value metrics aggregation that computes the weighted average of numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents.
Pipeline aggregations

Pipeline aggregations work on the outputs produced from other aggregations rather than from document sets, adding information to the output tree. There are many different types of pipeline aggregation, each computing different information from other aggregations, but these types can be broken down into two families:

Parent A family of pipeline aggregations that is provided with the output of its parent aggregation and is able to compute new buckets or new aggregations to add to existing buckets.

Sibling Pipeline aggregations that are provided with the output of a sibling aggregation and are able to compute a new aggregation which will be at the same level as the sibling aggregation.

  • Average bucket
    A sibling pipeline aggregation which calculates the mean value of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Bucket script
    A parent pipeline aggregation which executes a script which can perform per bucket computations on specified metrics in the parent multi-bucket aggregation. The specified metric must be numeric and the script must return a numeric value.
  • Bucket selector
    A parent pipeline aggregation which executes a script which determines whether the current bucket will be retained in the parent multi-bucket aggregation. The specified metric must be numeric and the script must return a boolean value. If the script language is expression then a numeric return value is permitted. In this case 0.0 will be evaluated as false and all other values will evaluate to true.
  • Bucket sort
    A parent pipeline aggregation which sorts the buckets of its parent multi-bucket aggregation. Zero or more sort fields may be specified together with the corresponding sort order. Each bucket may be sorted based on its _key, _count or its sub-aggregations. In addition, parameters from and size may be set in order to truncate the result buckets.
  • Cumulative cardinality [X-Pack]
    A parent pipeline aggregation which calculates the Cumulative Cardinality in a parent histogram (or date_histogram) aggregation.
  • Cumulative sum
    A parent pipeline aggregation which calculates the cumulative sum of a specified metric in a parent histogram (or date_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have min_doc_count set to 0 (default for histogram aggregations).
  • Derivative
    A parent pipeline aggregation which calculates the derivative of a specified metric in a parent histogram (or date_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have min_doc_count set to 0 (default for histogram aggregations).
  • Extended stats bucket
    A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Inference bucket [X-Pack]
    A parent pipeline aggregation which loads a pre-trained model and performs inference on the collated result fields from the parent bucket aggregation.
  • Max bucket
    A sibling pipeline aggregation which identifies the bucket(s) with the maximum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Min bucket
    A sibling pipeline aggregation which identifies the bucket(s) with the minimum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Moving average[Deprecated]
  • Moving function
    Given an ordered series of data, the Moving Function aggregation will slide a window across the data and allow the user to specify a custom script that is executed on each window of data. For convenience, a number of common functions are predefined such as min/max, moving averages, etc.
  • Moving percentiles [X-Pack]
    Given an ordered series of percentiles, the Moving Percentile aggregation will slide a window across those percentiles and allow the user to compute the cumulative percentile.
  • Normalize[X-Pack]
    A parent pipeline aggregation which calculates the specific normalized/rescaled value for a specific bucket value. Values that cannot be normalized, will be skipped using the skip gap policy.
  • Percentiles bucket
    A sibling pipeline aggregation which calculates percentiles across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Serial differencing
    Serial differencing is a technique where values in a time series are subtracted from itself at different time lags or periods. For example, the datapoint f(x) = f(xt) - f(xt-n), where n is the period being used.
  • Stats bucket
    A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
  • Sum bucket
    A sibling pipeline aggregation which calculates the sum across all buckets of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
Analyzers
  • Standard
    The standard analyzer divides text into terms on word boundaries, as defined by the Unicode Text Segmentation algorithm. It removes most punctuation, lowercases terms, and supports removing stop words.
  • Simple
    The simple analyzer divides text into terms whenever it encounters a character which is not a letter. It lowercases all terms.
  • Whitespace
    The whitespace analyzer divides text into terms whenever it encounters any whitespace character. It does not lowercase terms.
  • Stop
    The stop analyzer is like the simple analyzer, but also supports removal of stop words.
  • Keyword
    The keyword analyzer is a “noop” analyzer that accepts whatever text it is given and outputs the exact same text as a single term.
  • Pattern
    The pattern analyzer uses a regular expression to split the text into terms. It supports lower-casing and stop words.
  • Languages
    Elasticsearch provides many language-specific analyzers like english or french.
  • Fingerprint
    The fingerprint analyzer is a specialist analyzer which creates a fingerprint which can be used for duplicate detection.

Documentation

Overview

Package picker contains types for constructing queries in Elasticsearch

Index

Constants

View Source
const (
	DistanceTypeArc   = "arc"
	DistanceTypePlane = "plane"
)
View Source
const (
	DefaultMLTMaxQueryTerms          = 25
	DefaultMLTMinTermFreq            = 2
	DefaultMLTMinDocFreq             = 5
	DefaultMLTMinWordLen             = 0
	DefaultMLTMinimumShouldMatch     = "30%"
	DefaultMLTMaxDocFreq             = 2147483647
	DefaultMLTFailOnUnsupportedField = true
	DefaultMLTBoostTerms             = 0
	DefaultMLTInclude                = false
	DefaultMLTMinWordLength          = 0
	DefaultMLTMaxWordLength          = 0
)
View Source
const (
	// OperatorOr Operator
	//
	// For example, a query value of capital of Hungary is interpreted as
	// capital OR of OR Hungary.
	OperatorOr Operator = "OR"
	// OperatorAnd Operator
	//
	// For example, a query value of capital of Hungary is interpreted as capital
	// AND of AND Hungary.
	OperatorAnd Operator = "AND"
	And                  = OperatorAnd
	Or                   = OperatorOr
)
View Source
const (
	// SortMdoeMin - Pick the lowest value.
	SortModeMin = "min"
	// SortModeMax - Pick the highest value.
	SortModeMax = "max"
	// SortModeSum - Use the sum of all values as sort value. Only applicable for number based array fields.
	SortModeSum = "sum"
	// SortModeAvg - Use the average of all values as sort value. Only applicable for number based array fields.
	SortModeAvg = "avg"
	// Use the median of all values as sort value. Only applicable for number based array fields.
	SortModeMedian = "median"
)
View Source
const (
	// Sort in descending order
	SortOrderDescending = "desc"
	// Sort in ascending order
	SortOrderAscending = "asc"
)
View Source
const (
	ConflictsNotSpecified = ""
	ConflictsProceed      = "proceed"
	ConflictsAbort        = "abort"
)
View Source
const DefaultAllowLeadingWildcard = true
View Source
const DefaultAnalyzeWildcard = false
View Source
const DefaultAutoGenerateSynonymsPhraseQuery = true
View Source
const DefaultBoost = float64(1)
View Source
const DefaultBoostMode = BoostModeMultiply
View Source
const DefaultCaseInsensitive = false
View Source
const DefaultCoerce = false
View Source
const DefaultDistanceType = DistanceTypeArc
View Source
const DefaultDistanceValidationMethod = ValidationMethodStrict
View Source
const DefaultDocValues = true
View Source
const DefaultDynamic = DynamicTrue
View Source
const DefaultEagerGlobalOrdinals = false
View Source
const DefaultEnablePositionIncrements = false
View Source
const DefaultEnabled = true
View Source
const DefaultFieldData = false
View Source
const DefaultFormat = "strict_date_optional_time||epoch_millis"
View Source
const DefaultFuzziness = "0"
View Source
const DefaultFuzzyMaxExpansions = int(50)
View Source
const DefaultFuzzyPrefixLength = int(0)
View Source
const DefaultFuzzyTranspositions = true
View Source
const DefaultHasChildScoreMode = ScoreModeNone
View Source
const DefaultIgnoreAbove = float64(2147483647)
View Source
const DefaultIgnoreMalformed = false
View Source
const DefaultIgnoreZ = true
View Source
const DefaultIncludeInParent = false
View Source
const DefaultIncludeInRoot = false
View Source
const DefaultIndex = true
View Source
const DefaultIndexPhrases = false
View Source
const DefaultLenient = false
View Source
const DefaultMaxBoost = float64(math.MaxFloat32)
View Source
const DefaultMaxDeterminizedStates = 10000
View Source
const DefaultMaxExpansions = int(50)
View Source
const DefaultMaxGaps = -1
View Source
const DefaultMaxInputLength = 50
View Source
const DefaultMaxShingleSize = 3
View Source
const DefaultMinScore = float64(0)
View Source
const DefaultModifier = ModifierNone
View Source
const DefaultName = ""
View Source
const DefaultNestedScoreMode = ScoreModeAvg
View Source
const DefaultNorms = true
View Source
const DefaultOperator = OperatorOr
View Source
const DefaultOrdered = false
View Source
const DefaultOrientation = OrientationRight
View Source
const DefaultPhraseSlop = 0
View Source
const DefaultPositionIncrementGap = float64(100)
View Source
const DefaultPositiveScoreImpact = true
View Source
const DefaultPrefixLength = 0
View Source
const DefaultPreservePositionIncrements = true
View Source
const DefaultPreserveSeperators = true
View Source
const DefaultRelation = RelationIntersects
View Source
const DefaultRewrite = RewriteConstantScore
View Source
const DefaultScoreMode = ScoreModeMultiply
View Source
const DefaultSlop = 0
View Source
const DefaultSpatialRelation = SpatialRelationIntersects
View Source
const DefaultSplitQueriesOnWhitespace = false
View Source
const DefaultStore = false
View Source
const DefaultTermVector = TermVectorNo
View Source
const DefaultTranspositions = true
View Source
const DefaultWeight = float64(0)
View Source
const DefaultZeroTermsQuery = ZeroTermsNone

Variables

View Source
var (
	ErrKindRequired               = errors.New("picker: type is required")
	ErrUnsupportedType            = errors.New("picker: unsupported type")
	ErrFieldNotFound              = errors.New("picker: field not found")
	ErrFieldRequired              = errors.New("picker: field is required")
	ErrFieldsRequired             = errors.New("picker: fields is required")
	ErrValueRequired              = errors.New("picker: value is required")
	ErrQueryRequired              = errors.New("picker: query is required")
	ErrInvalidSource              = errors.New("picker: invalid value for source")
	ErrInvalidRewrite             = errors.New("picker: invalid value for rewrite")
	ErrFieldExists                = errors.New("picker: field exists")
	ErrPathRequired               = errors.New("picker: path is required")
	ErrIDRequired                 = errors.New("picker: id is required")
	ErrIndexRequired              = errors.New("picker: index is required")
	ErrInvalidBoost               = errors.New("picker: invalid value for boost")
	ErrInvalidFuzzyMaxExpansions  = errors.New("picker: invalid value for fuzzy_max_expansions")
	ErrInvalidMaxExpansions       = errors.New("picker: invalid value for max_expansions")
	ErrInvalidPrefixLength        = errors.New("picker: invalidvalue for prefix_length")
	ErrInvalidZeroTermQuery       = errors.New("picker: invalid value for zero_terms_query")
	ErrInvalidRelation            = errors.New("picker: invalid value for relation")
	ErrWeightRequired             = errors.New("picker: weight is required")
	ErrScriptRequired             = errors.New("picker: script is required")
	ErrInvalidParams              = errors.New("picker: params should marshal into a JSON object")
	ErrOriginRequired             = errors.New("picker: origin is required")
	ErrScaleRequired              = errors.New("picker: scale is required")
	ErrInvalidScoreMode           = errors.New("picker: invalid value for score_mode")
	ErrInvalidBoostMode           = errors.New("picker: invalid value for boost_mode")
	ErrInvalidModifier            = errors.New("picker: invalid value for modifier")
	ErrMetaLimitExceeded          = errors.New("picker: meta limit exceeded")
	ErrInvalidDynamic             = errors.New("picker: invalid value for dynamic")
	ErrInvalidIndexOptions        = errors.New("picker: invalid value for index_options")
	ErrInvalidIndexPrefixMaxChars = errors.New("picker: invalid value for index prefix_max_chars")
	ErrInvalidIndexPrefixMinChars = errors.New("picker: invalid value for index_prefix_min_chars")
	ErrScalingFactorRequired      = errors.New("picker: scaling_factor is required")
	ErrInvalidScalingFactor       = errors.New("picker: scaling_factor must be >= 1")
	ErrDimensionsRequired         = errors.New("picker: dimensions is required")
	ErrInvalidOrientation         = errors.New("picker: invalid orientation")
	ErrInvalidTermVector          = errors.New("picker: invalid TermVector")
	ErrMissingType                = errors.New("picker: missing type")
	ErrInvalidMaxShingleSize      = errors.New("picker: invalid max_shingle_size; valid values are [2,3,4]")
	ErrInvalidNegativeBoost       = errors.New("picker: negative_boost must be between 0 and 1.0")
	ErrNegativeRequired           = errors.New("picker: negative is required")
	ErrPositiveRequired           = errors.New("picker: positive is required")
	ErrQueriesRequired            = errors.New("picker: queries is required")
	ErrSourceRequired             = errors.New("picker: source is required")
	ErrPrefixRequired             = errors.New("picker: prefix is required")
	ErrWildcardRequired           = errors.New("picker: wildcard is required")
	ErrTermRequired               = errors.New("picker: term is required")
	ErrTermsRequired              = errors.New("picker: terms is required")
	ErrValuesRequired             = errors.New("picker: values is required")
	ErrIntervalsRequired          = errors.New("picker: intervals are required")
	ErrInvalidOperator            = errors.New("picker: invalid operator")
	ErrInvalidMultiMatchType      = errors.New("picker: invalid multimatch type")
	ErrInvalidTieBreaker          = errors.New("picker: invalid tie breaker value ")
	ErrDistanceRequired           = errors.New("picker: distance is required")
	ErrGeoPointRequired           = errors.New("picker: GeoPoint is required")
	ErrLikeRequired               = errors.New("picker: like is required")
	ErrTypeRequired               = errors.New("picker: type is required")
	ErrPivotRequired              = errors.New("picker: pivot is required")
	ErrInvalidPivot               = errors.New("picker: pivot must be > 0")
	ErrInvalidExponent            = errors.New("picker: exponent must be > 0")
	ErrExponentRequired           = errors.New("picker: exponent is required")
	ErrMultiRankFeatureFunctions  = errors.New("picker: only one function saturation, log, sigmoid or linear can be provided")
)
View Source
var (
	DefaultExplain = false
	DefaultFrom    = int(0)
	DefaultSize    = int(10)
)
View Source
var DefaultConflicts = ConflictsAbort
View Source
var DepthLimitDefault = float64(20)
View Source
var (
	// ErrInvalidType indicates an invalid type
	ErrInvalidType = errors.New("invalid Type")
)
View Source
var FieldTypeHandlers = map[FieldType]func() Field{
	FieldTypeAlias:           func() Field { return &AliasField{} },
	FieldTypeBinary:          func() Field { return &BinaryField{} },
	FieldTypeBoolean:         func() Field { return &BooleanField{} },
	FieldTypeByte:            func() Field { return &ByteField{} },
	FieldTypeCompletion:      func() Field { return &CompletionField{} },
	FieldTypeConstant:        func() Field { return &ConstantField{} },
	FieldTypeDate:            func() Field { return &DateField{} },
	FieldTypeDateNanos:       func() Field { return &DateNanoSecField{} },
	FieldTypeDateRange:       func() Field { return &DateRangeField{} },
	FieldTypeDenseVector:     func() Field { return &DenseVectorField{} },
	FieldTypeDouble:          func() Field { return &DoubleField{} },
	FieldTypeDoubleRange:     func() Field { return &DoubleRangeField{} },
	FieldTypeFlattened:       func() Field { return &FlattenedField{} },
	FieldTypeFloat:           func() Field { return &FloatField{} },
	FieldTypeFloatRange:      func() Field { return &FloatRangeField{} },
	FieldTypePoint:           func() Field { return &PointField{} },
	FieldTypeGeoPoint:        func() Field { return &GeoPointField{} },
	FieldTypeGeoShape:        func() Field { return &GeoShapeField{} },
	FieldTypeShape:           func() Field { return &ShapeField{} },
	FieldTypeHalfFloat:       func() Field { return &HalfFloatField{} },
	FieldTypeIP:              func() Field { return &IPField{} },
	FieldTypeIPRange:         func() Field { return &IPRangeField{} },
	FieldTypeInteger:         func() Field { return &IntegerField{} },
	FieldTypeIntegerRange:    func() Field { return &IntegerRangeField{} },
	FieldTypeJoin:            func() Field { return &JoinField{} },
	FieldTypeKeyword:         func() Field { return &KeywordField{} },
	FieldTypeLong:            func() Field { return &LongField{} },
	FieldTypeLongRange:       func() Field { return &LongRangeField{} },
	FieldTypeNested:          func() Field { return &NestedField{} },
	FieldTypeObject:          func() Field { return &ObjectField{} },
	FieldTypePercolator:      func() Field { return &PercolatorField{} },
	FieldTypeRankFeature:     func() Field { return &RankFeatureField{} },
	FieldTypeRankFeatures:    func() Field { return &RankFeaturesField{} },
	FieldTypeScaledFloat:     func() Field { return &ScaledFloatField{} },
	FieldTypeSearchAsYouType: func() Field { return &SearchAsYouTypeField{} },
	FieldTypeShort:           func() Field { return &ShortField{} },
	FieldTypeText:            func() Field { return &TextField{} },
	FieldTypeTokenCount:      func() Field { return &TokenCountField{} },
	FieldTypeUnsignedLong:    func() Field { return &UnsignedLongField{} },
	FieldTypeWildcardKeyword: func() Field { return &WildcardField{} },
	FieldTypeHistogram:       func() Field { return &HistogramField{} },
}

FieldTypeHandlers is a map of mapping Type to func that returns a Field instantiated with the appropriate Type

Functions

func MarshalRule

func MarshalRule(rule QueryRule) ([]byte, error)

func Number

func Number(n dynamic.Number) *number

Number returns a new DynamicNumber It panics if v can not be set to a dynamic.Number

see https://github.com/chanced/dynamic/blob/main/number.go

func UnmarshalFieldJSON

func UnmarshalFieldJSON(data []byte, field *Field) error

Types

type AggKind

type AggKind string
const (
	AggKindAdjacencyMatrix           AggKind = "adjacency_matrix"
	AggKindAutoIntervalDateHistogram AggKind = "auto_date_histogram"
	AggKindChildren                  AggKind = "children"
	AggKindComposite                 AggKind = "composite"
	AggKindDateHistogram             AggKind = "date_histogram"
	AggKindDateRange                 AggKind = "date_range"
	AggKindDiversifiedSampler        AggKind = "diversified_sampler"
	AggKindFilter                    AggKind = "filter"
	AggKindFilters                   AggKind = "filters"
	AggKindGeoDistance               AggKind = "geo_distance"
	AggKindGeohashGrid               AggKind = "geohash_grid"
	AggKindGeotileGrid               AggKind = "geotile_grid"
	AggKindGlobal                    AggKind = "global"
	AggKindHistogram                 AggKind = "histogram"
	AggKindIPPange                   AggKind = "ip_range"
	AggKindMissing                   AggKind = "missing"
	AggKindMultiTerms                AggKind = "multi_terms"
	AggKindNested                    AggKind = "nested"
	AggKindParent                    AggKind = "parent"
	AggKindRange                     AggKind = "range"
	AggKindRareTerms                 AggKind = "rare_terms"
	AggKindReverseNested             AggKind = "reverse_nested"
	AggKindSampler                   AggKind = "sampler"
	AggKindSignificantTerms          AggKind = "significant_terms"
	AggKindSignificantText           AggKind = "significant_text"
	AggKindTerms                     AggKind = "terms"
	AggKindVariableWidthHistogram    AggKind = "variable_width_histogram"
	AggKindAvg                       AggKind = "avg"
	AggKindBoxplot                   AggKind = "boxplot"
	AggKindCardinality               AggKind = "cardinality"
	AggKindExtendedStats             AggKind = "extended_stats"
	AggKindGeoBounds                 AggKind = "geo_bounds"
	AggKindGeoCentroid               AggKind = "geo_centroid"
	AggKindGeoLine                   AggKind = "geo_line"
	AggKindMatrixStats               AggKind = "matrix_stats"
	AggKindMax                       AggKind = "max"
	AggKindMedianAbsoluteDeviation   AggKind = "median_absolute_deviation"
	AggKindMin                       AggKind = "min"
	AggKindPercentileRanks           AggKind = "percentile_ranks"
	AggKindPercentiles               AggKind = "percentiles"
	AggKindRate                      AggKind = "rate"
	AggKindScriptedMetric            AggKind = "metric"
	AggKindStats                     AggKind = "stats"
	AggKindStringStats               AggKind = "string_stats"
	AggKindSum                       AggKind = "sum"
	AggKindTTest                     AggKind = "t_test"
	AggKindTopHits                   AggKind = "top_hits"
	AggKindTopMetrics                AggKind = "top_metrics"
	AggKindValueCount                AggKind = "value_count"
	AggKindWeightedAvg               AggKind = "weighted_avg"
	AggKindAverageBucket             AggKind = "avg_bucket"
	AggKindBucketScript              AggKind = "bucket_script"
	AggKindBucketSelector            AggKind = "bucket_selector"
	AggKindBucketSort                AggKind = "bucket_sort"
	AggKindCumulativeCardinality     AggKind = "cumulative_cardinality"
	AggKindCumulativeSum             AggKind = "cumulative_sum"
	AggKindDerivative                AggKind = "derivative"
	AggKindExtendedStatsBucket       AggKind = "extended_stats_bucket"
	AggKindInferenceBucket           AggKind = "inference"
	AggKindMaxBucket                 AggKind = "max_bucket"
	AggKindMinBucket                 AggKind = "min_bucket"
	AggKindMovingAverage             AggKind = "moving_avg"
	AggKindMovingFunction            AggKind = "moving_fn"
	AggKindMovingPercentiles         AggKind = "moving_percentiles"
	AggKindNormalize                 AggKind = "normalize"
	AggKindPercentilesBucket         AggKind = "percentiles_bucket"
	AggKindSerialDifferencing        AggKind = "serial_diff"
	AggKindStatsBucket               AggKind = "stats_bucket"
	AggKindSumBucket                 AggKind = "sum_bucket"
)

type AliasField

type AliasField struct {
	// contains filtered or unexported fields
}

An AliasField mapping defines an alternate name for a field in the index. The alias can be used in place of the target field in search requests, and selected other APIs like field capabilities.

Alias targets

There are a few restrictions on the target of an alias:

- The target must be a concrete field, and not an object or another field alias.

- The target field must exist at the time the alias is created.

- If nested objects are defined, a field alias must have the same nested scope as its target.

- Additionally, a field alias can only have one target. This means that it is not possible to use a field alias to query over multiple target fields in a single clause.

An alias can be changed to refer to a new target through a mappings update. A known limitation is that if any stored percolator queries contain the field alias, they will still refer to its original target. More information can be found in the percolator documentation.

Currently only the search and field capabilities APIs will accept and resolve field aliases. Other APIs that accept field names, such as term vectors, cannot be used with field aliases.

Finally, some queries, such as terms, geo_shape, and more_like_this, allow for fetching query information from an indexed document. Because field aliases aren’t supported when fetching documents, the part of the query that specifies the lookup path cannot refer to a field by its alias.

https://www.elastic.co/guide/en/elasticsearch/reference/current/alias.html

func NewAliasField

func NewAliasField(params AliasFieldParams) (*AliasField, error)

func (*AliasField) Field

func (a *AliasField) Field() (Field, error)

func (AliasField) MarshalBSON

func (a AliasField) MarshalBSON() ([]byte, error)

func (AliasField) MarshalJSON

func (a AliasField) MarshalJSON() ([]byte, error)

func (AliasField) Path

func (a AliasField) Path() string

Path is the path for an alias

func (*AliasField) SetPath

func (a *AliasField) SetPath(path string) error

SetPath sets path to path

func (AliasField) Type

func (AliasField) Type() FieldType

func (*AliasField) UnmarshalBSON

func (a *AliasField) UnmarshalBSON(data []byte) error

func (*AliasField) UnmarshalJSON

func (a *AliasField) UnmarshalJSON(data []byte) error

type AliasFieldParams

type AliasFieldParams struct {
	// The path to the target field. Note that this must be the full path, including any parent objects (e.g. object1.object2.field).
	Path string `json:"path"`
}

func (AliasFieldParams) Alias

func (a AliasFieldParams) Alias() (*AliasField, error)

func (AliasFieldParams) Field

func (a AliasFieldParams) Field() (Field, error)

func (AliasFieldParams) Type

func (AliasFieldParams) Type() FieldType

type Aliaser

type Aliaser interface {
	Alias() (*AliasField, error)
}

type AllOfQuery

type AllOfQuery struct {
	// contains filtered or unexported fields
}

func (*AllOfQuery) Clause

func (ao *AllOfQuery) Clause() (QueryClause, error)

func (*AllOfQuery) Clear

func (ao *AllOfQuery) Clear()

func (AllOfQuery) Complete

func (AllOfQuery) Complete()

func (*AllOfQuery) Disable

func (ao *AllOfQuery) Disable()

func (*AllOfQuery) Enable

func (ao *AllOfQuery) Enable()

func (*AllOfQuery) IsEmpty

func (ao *AllOfQuery) IsEmpty() bool

func (AllOfQuery) Kind

func (AllOfQuery) Kind() QueryKind

func (AllOfQuery) MarshalJSON

func (ao AllOfQuery) MarshalJSON() ([]byte, error)

func (AllOfQuery) Name

func (n AllOfQuery) Name() string

func (*AllOfQuery) SetName

func (n *AllOfQuery) SetName(name string)

func (*AllOfQuery) UnmarshalJSON

func (ao *AllOfQuery) UnmarshalJSON(data []byte) error

type AllOfQueryParams

type AllOfQueryParams struct {
	Name string
}

func (AllOfQueryParams) AllOf

func (ao AllOfQueryParams) AllOf() (*AllOfQuery, error)

func (AllOfQueryParams) Clause

func (ao AllOfQueryParams) Clause() (CompleteClause, error)

func (AllOfQueryParams) Kind

func (ao AllOfQueryParams) Kind() QueryKind

type AllOfRule

type AllOfRule struct {
	// contains filtered or unexported fields
}

func (*AllOfRule) AllOfRule

func (a *AllOfRule) AllOfRule() (*AllOfRule, error)

func (AllOfRule) Filter

func (r AllOfRule) Filter() *RuleFilter

func (AllOfRule) Intervals

func (a AllOfRule) Intervals() Rules

func (AllOfRule) MarshalBSON

func (a AllOfRule) MarshalBSON() ([]byte, error)

func (AllOfRule) MarshalJSON

func (a AllOfRule) MarshalJSON() ([]byte, error)

func (AllOfRule) MaxGaps

func (mg AllOfRule) MaxGaps() int

func (AllOfRule) Ordered

func (o AllOfRule) Ordered() bool

func (*AllOfRule) Rule

func (a *AllOfRule) Rule() (QueryRule, error)

func (*AllOfRule) SetFilter

func (r *AllOfRule) SetFilter(filter RuleFilterer) error

func (*AllOfRule) SetIntervals

func (a *AllOfRule) SetIntervals(intervals Ruleset) error

func (*AllOfRule) SetMaxGaps

func (mg *AllOfRule) SetMaxGaps(maxGaps interface{}) error

func (*AllOfRule) SetOrdered

func (o *AllOfRule) SetOrdered(ordered interface{}) error

func (AllOfRule) Type

func (AllOfRule) Type() RuleType

func (*AllOfRule) UnmarshalBSON

func (a *AllOfRule) UnmarshalBSON(data []byte) error

func (*AllOfRule) UnmarshalJSON

func (a *AllOfRule) UnmarshalJSON(data []byte) error

type AllOfRuleParams

type AllOfRuleParams struct {

	// (Required, array of rule objects) An array of rules to combine. All rules
	// must produce a match in a document for the overall source to match.
	Intervals Ruleset `json:"intervals"`
	// (Optional, Boolean) If true, intervals produced by the rules should
	// appear in the order in which they are specified. Defaults to false.
	Ordered interface{} `json:"ordered,omitempty"`
	// (Optional) Rule used to filter returned intervals.
	Filter  RuleFilterer `json:"filter,omitempty"`
	MaxGaps interface{}  `json:"max_gaps,omitempty"`
}

func (AllOfRuleParams) AllOfRule

func (p AllOfRuleParams) AllOfRule() (*AllOfRule, error)

func (AllOfRuleParams) Rule

func (p AllOfRuleParams) Rule() (QueryRule, error)

func (AllOfRuleParams) Type

func (AllOfRuleParams) Type() RuleType

type AllOfer

type AllOfer interface {
	AllOf() (*AllOfQuery, error)
}

type AnyOfRule

type AnyOfRule struct {
	// contains filtered or unexported fields
}

func (*AnyOfRule) AnyOfRule

func (a *AnyOfRule) AnyOfRule() (*AnyOfRule, error)

func (AnyOfRule) Filter

func (r AnyOfRule) Filter() *RuleFilter

func (AnyOfRule) Intervals

func (a AnyOfRule) Intervals() Rules

func (AnyOfRule) MarshalBSON

func (a AnyOfRule) MarshalBSON() ([]byte, error)

func (AnyOfRule) MarshalJSON

func (a AnyOfRule) MarshalJSON() ([]byte, error)

func (*AnyOfRule) Rule

func (a *AnyOfRule) Rule() (QueryRule, error)

func (*AnyOfRule) SetFilter

func (r *AnyOfRule) SetFilter(filter RuleFilterer) error

func (*AnyOfRule) SetIntervals

func (a *AnyOfRule) SetIntervals(intervals Ruleset) error

func (AnyOfRule) Type

func (AnyOfRule) Type() RuleType

func (*AnyOfRule) UnmarshalBSON

func (a *AnyOfRule) UnmarshalBSON(data []byte) error

func (*AnyOfRule) UnmarshalJSON

func (a *AnyOfRule) UnmarshalJSON(data []byte) error

type AnyOfRuleParams

type AnyOfRuleParams struct {
	// (Required, array of rule objects) An array of rules to match.
	Intervals Ruleset `json:"intervals"`
	// (Optional, interval filter rule object) Rule used to filter returned intervals.
	Filter RuleFilterer `json:"filter,omitempty"`
}

func (AnyOfRuleParams) AnyOfRule

func (p AnyOfRuleParams) AnyOfRule() (*AnyOfRule, error)

func (AnyOfRuleParams) Rule

func (p AnyOfRuleParams) Rule() (QueryRule, error)

func (AnyOfRuleParams) Type

func (AnyOfRuleParams) Type() RuleType

type BinaryField

type BinaryField struct {
	// contains filtered or unexported fields
}

BinaryField is a value encoded as a Base64 string.

https://www.elastic.co/guide/en/elasticsearch/reference/current/binary.html

func NewBinaryField

func NewBinaryField(params BinaryFieldParams) (*BinaryField, error)

func (BinaryField) DocValues

func (dv BinaryField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (BinaryField) Field

func (b BinaryField) Field() (Field, error)

func (BinaryField) MarshalBSON

func (b BinaryField) MarshalBSON() ([]byte, error)

func (BinaryField) MarshalJSON

func (b BinaryField) MarshalJSON() ([]byte, error)

func (*BinaryField) SetDocValues

func (dv *BinaryField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*BinaryField) SetStore

func (sa *BinaryField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (BinaryField) Store

func (sa BinaryField) Store() bool

Store returns the StoreAttr Value or false

func (BinaryField) Type

func (BinaryField) Type() FieldType

func (*BinaryField) UnmarshalBSON

func (b *BinaryField) UnmarshalBSON(data []byte) error

func (*BinaryField) UnmarshalJSON

func (b *BinaryField) UnmarshalJSON(data []byte) error

type BinaryFieldParams

type BinaryFieldParams struct {
	// Should the field be stored on disk in a column-stride fashion, so that it can later be used for sorting, aggregations, or scripting? Accepts true or false (default).
	DocValues interface{} `json:"doc_values,omitempty"`
	// Whether the field value should be stored and retrievable separately from the _source field. Accepts true or false (default).
	Store interface{} `json:"store,omitempty"`
}

func (BinaryFieldParams) Binary

func (b BinaryFieldParams) Binary() (*BinaryField, error)

func (BinaryFieldParams) Field

func (b BinaryFieldParams) Field() (Field, error)

func (BinaryFieldParams) Type

type BoolQuery

type BoolQuery struct {
	// contains filtered or unexported fields
}

BoolQuery is a query that matches documents matching boolean combinations of other queries. The bool query maps to Lucene BoolQuery. It is built using one or more boolean clauses, each clause with a typed occurrence.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html

func (*BoolQuery) Clause

func (b *BoolQuery) Clause() (QueryClause, error)

func (*BoolQuery) Clear

func (b *BoolQuery) Clear()

func (BoolQuery) Complete

func (BoolQuery) Complete()

func (*BoolQuery) Filter

func (b *BoolQuery) Filter() *QueryClauses

Filter clauses (query) that must appear in matching documents. However unlike must the score of the query will be ignored. Filter clauses are executed in filter context, meaning that scoring is ignored and clauses are considered for caching.

func (*BoolQuery) IsEmpty

func (b *BoolQuery) IsEmpty() bool

func (BoolQuery) Kind

func (BoolQuery) Kind() QueryKind

func (BoolQuery) MarshalBSON

func (b BoolQuery) MarshalBSON() ([]byte, error)

func (BoolQuery) MarshalJSON

func (b BoolQuery) MarshalJSON() ([]byte, error)

func (BoolQuery) MinimumShouldMatch

func (msm BoolQuery) MinimumShouldMatch() string

func (*BoolQuery) Must

func (b *BoolQuery) Must() *QueryClauses

Must clauses (query) must appear in matching documents and will contribute to the score.

func (*BoolQuery) MustNot

func (b *BoolQuery) MustNot() *QueryClauses

MustNot is a set of clauses (query) where each clause must not appear in the matching documents. Clauses are executed in filter context meaning that scoring is ignored and clauses are considered for caching. Because scoring is ignored, a score of 0 for all documents is returned.

func (BoolQuery) Name

func (n BoolQuery) Name() string

func (*BoolQuery) Set

func (b *BoolQuery) Set(v Booler) error

func (*BoolQuery) SetFilter

func (b *BoolQuery) SetFilter(clauses Clauses) error

func (*BoolQuery) SetMinimumShouldMatch

func (msm *BoolQuery) SetMinimumShouldMatch(v string)

func (*BoolQuery) SetMust

func (b *BoolQuery) SetMust(clauses Clauses) error

func (*BoolQuery) SetMustNot

func (b *BoolQuery) SetMustNot(clauses Clauses) error

func (*BoolQuery) SetName

func (n *BoolQuery) SetName(name string)

func (*BoolQuery) SetShould

func (b *BoolQuery) SetShould(clauses Clauses) error

func (*BoolQuery) Should

func (b *BoolQuery) Should() *QueryClauses

Should clauses (query) that should appear in the matching document.

func (*BoolQuery) UnmarshalBSON

func (b *BoolQuery) UnmarshalBSON(data []byte) error

func (*BoolQuery) UnmarshalJSON

func (b *BoolQuery) UnmarshalJSON(data []byte) error

type BoolQueryParams

type BoolQueryParams struct {
	// The clause (query) must appear in matching documents and will contribute
	// to the score.
	Must Clauses
	// The clause (query) must appear in matching documents. However unlike must
	// the score of the query will be ignored. Filter clauses are executed in
	// filter context, meaning that scoring is ignored and clauses are
	// considered for caching.
	Filter Clauses
	// The clause (query) should appear in the matching document.
	Should Clauses
	// The clause (query) must not appear in the matching documents. Clauses are
	// executed in filter context meaning that scoring is ignored and clauses are
	// considered for caching. Because scoring is ignored, a score of 0 for all
	// documents is returned.
	MustNot Clauses
	// You can use the minimum_should_match parameter to specify the number or
	// percentage of should clauses returned documents must match.
	//
	// If the bool query includes at least one should clause and no must or
	// filter clauses, the default value is 1. Otherwise, the default value is
	// 0.
	MinimumShouldMatch string
	Name               string
	// contains filtered or unexported fields
}

BoolQueryParams is a query that matches documents matching boolean combinations of other queries. The bool query maps to Lucene BoolQueryParams. It is built using one or more boolean clauses, each clause with a typed occurrence.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html

func (BoolQueryParams) Bool

func (b BoolQueryParams) Bool() (*BoolQuery, error)

func (BoolQueryParams) Clause

func (b BoolQueryParams) Clause() (QueryClause, error)

func (BoolQueryParams) Complete

func (BoolQueryParams) Complete()

func (BoolQueryParams) Kind

func (b BoolQueryParams) Kind() QueryKind

type BooleanField

type BooleanField struct {
	// contains filtered or unexported fields
}

BooleanField accepts JSON true and false values, but can also accept strings which are interpreted as either true or false:

False values

false, "false", "" (empty string)

True values

true, "true"

func NewBooleanField

func NewBooleanField() *BooleanField

func (BooleanField) DocValues

func (dv BooleanField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*BooleanField) Field

func (b *BooleanField) Field() (Field, error)

func (BooleanField) Index

func (i BooleanField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (BooleanField) MarshalBSON

func (b BooleanField) MarshalBSON() ([]byte, error)

func (BooleanField) MarshalJSON

func (b BooleanField) MarshalJSON() ([]byte, error)

func (BooleanField) Meta

func (m BooleanField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (BooleanField) NullValue

func (nv BooleanField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*BooleanField) SetDocValues

func (dv *BooleanField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*BooleanField) SetIndex

func (i *BooleanField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*BooleanField) SetMeta

func (m *BooleanField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*BooleanField) SetNullValue

func (nv *BooleanField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*BooleanField) SetStore

func (sa *BooleanField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (BooleanField) Store

func (sa BooleanField) Store() bool

Store returns the StoreAttr Value or false

func (BooleanField) Type

func (BooleanField) Type() FieldType

func (*BooleanField) UnmarshalBSON

func (b *BooleanField) UnmarshalBSON(data []byte) error

func (*BooleanField) UnmarshalJSON

func (b *BooleanField) UnmarshalJSON(data []byte) error

type BooleanFieldParams

type BooleanFieldParams struct {

	// DocValues sets doc_values (Optional, bool or string that can be parsed as a bool)
	//
	// Most fields are indexed by default, which makes them searchable. The inverted
	// index allows queries to look up the search term in unique sorted list of
	// terms, and from that immediately have access to the list of documents that
	// contain the term.
	//
	// Sorting, aggregations, and access to field values in scripts requires a
	// different data access pattern. Instead of looking up the term and finding
	// documents, we need to be able to look up the document and find the terms that
	// it has in a field.
	//
	// Doc values are the on-disk data structure, built at document index time,
	// which makes this data access pattern possible. They store the same values as
	// the _source but in a column-oriented fashion that is way more efficient for
	// sorting and aggregations. Doc values are supported on almost all field types,
	// with the notable exception of text and annotated_text fields.
	//
	// All fields which support doc values have them enabled by default. If you are
	// sure that you don’t need to sort or aggregate on a field, or access the field
	// value from a script, you can disable doc values in order to save disk space
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
	DocValues interface{} `json:"doc_values,omitempty"`

	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool or string that can be parsed as a bool)
	Index interface{} `json:"index,omitempty"`
	// A null value cannot be indexed or searched. When a field is set to null, (or
	// an empty array or an array of null values) it is treated as though that field
	// has no values.
	//
	// The null_value parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	//
	// The null_value needs to be the same data type as the field. For instance, a
	// long field cannot have a string null_value.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/null-value.html
	NullValue interface{} `json:"null_value,omitempty"`

	// By default, field values are indexed to make them searchable, but they
	// are not stored. This means that the field can be queried, but the
	// original field value cannot be retrieved.
	//
	// (Optional, bool or string that can be parsed as a bool)
	//
	// Usually this doesn’t matter. The field value is already part of the
	// _source field, which is stored by default. If you only want to retrieve
	// the value of a single field or of a few fields, instead of the whole
	// _source, then this can be achieved with source filtering.
	//
	// In certain situations it can make sense to store a field. For instance,
	// if you have a document with a title, a date, and a very large content
	// field, you may want to retrieve just the title and the date without
	// having to extract those fields from a large _source field
	//
	// Stored fields returned as arrays
	//
	// For consistency, stored fields are always returned as an array because
	// there is no way of knowing if the original field value was a single
	// value, multiple values, or an empty array.
	//
	// The original value can be retrieved from the _source field instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
	Store interface{} `json:"store,omitempty"`

	// Metadata attached to the field. This metadata is opaque to Elasticsearch, it
	// is only useful for multiple applications that work on the same indices to
	// share meta information about fields such as units
	//
	// map[string]string or picker.Meta
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-field-meta.html#mapping-field-meta
	Meta map[string]string `json:"meta,omitempty"`
}

func (BooleanFieldParams) Boolean

func (b BooleanFieldParams) Boolean() (*BooleanField, error)

func (BooleanFieldParams) Field

func (b BooleanFieldParams) Field() (Field, error)

func (BooleanFieldParams) Type

type Booler

type Booler interface {
	Bool() (*BoolQuery, error)
}

type BoostMode

type BoostMode string
const (
	BoostModeUnspecified BoostMode = ""
	// query score and function score is multiplied (default)
	BoostModeMultiply BoostMode = "multiply"
	// only function score is used, the query score is ignored
	BoostModeReplace BoostMode = "replace"
	// query score and function score are added
	BoostModeSum BoostMode = "sum"
	// average
	BoostModeAvg BoostMode = "avg"
	// max of query score and function score
	BoostModeMax BoostMode = "max"
	//min of query score and function score
	BoostModeMin BoostMode = "min"
)

func (*BoostMode) IsValid

func (bm *BoostMode) IsValid() bool

func (BoostMode) String

func (bm BoostMode) String() string

type BoostingQuery

type BoostingQuery struct {
	// contains filtered or unexported fields
}

BoostingQuery returns documents matching a positive query while reducing the relevance score of documents that also match a negative query.

You can use the boosting query to demote certain documents without excluding them from the search results.

func (*BoostingQuery) Clause

func (b *BoostingQuery) Clause() (QueryClause, error)

func (*BoostingQuery) Clear

func (b *BoostingQuery) Clear()

func (BoostingQuery) Complete

func (BoostingQuery) Complete()

func (*BoostingQuery) IsEmpty

func (b *BoostingQuery) IsEmpty() bool

func (BoostingQuery) Kind

func (BoostingQuery) Kind() QueryKind

func (BoostingQuery) MarshalBSON

func (b BoostingQuery) MarshalBSON() ([]byte, error)

func (BoostingQuery) MarshalJSON

func (b BoostingQuery) MarshalJSON() ([]byte, error)

func (BoostingQuery) Name

func (n BoostingQuery) Name() string

func (BoostingQuery) Negative

func (b BoostingQuery) Negative() *Query

func (BoostingQuery) NegativeBoost

func (nb BoostingQuery) NegativeBoost() float64

NegativeBoost is a floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the negative query. (Required)

func (BoostingQuery) Positive

func (b BoostingQuery) Positive() *Query

func (*BoostingQuery) SetName

func (n *BoostingQuery) SetName(name string)

func (*BoostingQuery) SetNegative

func (b *BoostingQuery) SetNegative(params Querier) error

func (*BoostingQuery) SetNegativeBoost

func (nb *BoostingQuery) SetNegativeBoost(negativeBoost float64) error

SetNegativeBoost sets negative_boost

func (*BoostingQuery) SetPositive

func (b *BoostingQuery) SetPositive(params Querier) error

func (*BoostingQuery) UnmarshalBSON

func (b *BoostingQuery) UnmarshalBSON(data []byte) error

func (*BoostingQuery) UnmarshalJSON

func (b *BoostingQuery) UnmarshalJSON(data []byte) error

type BoostingQueryParams

type BoostingQueryParams struct {
	// (Required, query object) Query you wish to run. Any returned documents
	// must match this query.
	Positive Querier
	// (Required, query object) Query used to decrease the relevance score of
	// matching documents.
	//
	// If a returned document matches the positive query and this query, the
	// boosting query calculates the final relevance score for the document as
	// follows:
	//
	// 1. Take the original relevance score from the positive query. 2. Multiply
	// the score by the negative_boost value.
	Negative Querier

	// (Required, float) Floating point number between 0 and 1.0 used to
	// decrease the relevance scores of documents matching the negative query.
	NegativeBoost float64

	Name string
}

func (BoostingQueryParams) Boosting

func (p BoostingQueryParams) Boosting() (*BoostingQuery, error)

func (BoostingQueryParams) Clause

func (p BoostingQueryParams) Clause() (QueryClause, error)

type Boostinger

type Boostinger interface {
	Boosting() (*BoostingQuery, error)
}

type BoundingBox

type BoundingBox struct {
	TopLeft     interface{} `json:"top_left"`
	BottomRight interface{} `json:"bottom_right"`
}

BoundingBox for GeoBoundingBoxQuery

func (BoundingBox) BoundingBox

func (bb BoundingBox) BoundingBox() interface{}

func (BoundingBox) MarshalEasyJSON

func (v BoundingBox) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BoundingBox) MarshalJSON

func (v BoundingBox) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BoundingBox) UnmarshalEasyJSON

func (v *BoundingBox) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BoundingBox) UnmarshalJSON

func (v *BoundingBox) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BoundingBoxer

type BoundingBoxer interface {
	BoundingBox() interface{}
	json.Marshaler
}

type ByteField

type ByteField struct {
	// contains filtered or unexported fields
}

A ByteField is a signed 8-bit integer with a minimum value of -128 and a maximum value of 127.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewByteField

func NewByteField(params ByteFieldParams) (*ByteField, error)

func (ByteField) Boost

func (b ByteField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (ByteField) Coerce

func (cp ByteField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (ByteField) DocValues

func (dv ByteField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*ByteField) Field

func (b *ByteField) Field() (Field, error)

func (ByteField) IgnoreMalformed

func (im ByteField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (ByteField) Index

func (i ByteField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (ByteField) MarshalBSON

func (b ByteField) MarshalBSON() ([]byte, error)

func (ByteField) MarshalJSON

func (b ByteField) MarshalJSON() ([]byte, error)

func (ByteField) Meta

func (m ByteField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (ByteField) NullValue

func (nv ByteField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*ByteField) SetBoost

func (b *ByteField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*ByteField) SetCoerce

func (cp *ByteField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*ByteField) SetDocValues

func (dv *ByteField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*ByteField) SetIgnoreMalformed

func (im *ByteField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*ByteField) SetIndex

func (i *ByteField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*ByteField) SetMeta

func (m *ByteField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*ByteField) SetNullValue

func (nv *ByteField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*ByteField) SetStore

func (sa *ByteField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (ByteField) Store

func (sa ByteField) Store() bool

Store returns the StoreAttr Value or false

func (ByteField) Type

func (ByteField) Type() FieldType

func (*ByteField) UnmarshalBSON

func (b *ByteField) UnmarshalBSON(data []byte) error

func (*ByteField) UnmarshalJSON

func (b *ByteField) UnmarshalJSON(data []byte) error

type ByteFieldParams

type ByteFieldParams numberFieldParams

func (ByteFieldParams) Byte

func (p ByteFieldParams) Byte() (*ByteField, error)

func (ByteFieldParams) Field

func (p ByteFieldParams) Field() (Field, error)

func (ByteFieldParams) Type

func (ByteFieldParams) Type() FieldType

type Clause

type Clause interface {
	Kind() QueryKind
}

type Clauser

type Clauser interface {
	Clause
	Clause() (QueryClause, error)
}

type Clauses

type Clauses []CompleteClauser

func (*Clauses) Add

func (c *Clauses) Add(clause CompleteClauser) error

type CommonQuery

type CommonQuery struct {
	// contains filtered or unexported fields
}

func (*CommonQuery) Clause

func (q *CommonQuery) Clause() (QueryClause, error)

func (*CommonQuery) Clear

func (q *CommonQuery) Clear()

func (*CommonQuery) Common

func (q *CommonQuery) Common() (*CommonQuery, error)

func (CommonQuery) Complete

func (CommonQuery) Complete()

func (*CommonQuery) IsEmpty

func (q *CommonQuery) IsEmpty() bool

func (CommonQuery) Kind

func (CommonQuery) Kind() QueryKind

func (CommonQuery) MarshalBSON

func (q CommonQuery) MarshalBSON() ([]byte, error)

func (CommonQuery) MarshalJSON

func (q CommonQuery) MarshalJSON() ([]byte, error)

func (CommonQuery) Name

func (n CommonQuery) Name() string

func (*CommonQuery) SetName

func (n *CommonQuery) SetName(name string)

func (*CommonQuery) UnmarshalBSON

func (q *CommonQuery) UnmarshalBSON(data []byte) error

func (*CommonQuery) UnmarshalJSON

func (q *CommonQuery) UnmarshalJSON(data []byte) error

type CommonQueryParams

type CommonQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (CommonQueryParams) Clause

func (p CommonQueryParams) Clause() (QueryClause, error)

func (CommonQueryParams) Common

func (p CommonQueryParams) Common() (*CommonQuery, error)

func (CommonQueryParams) Complete

func (CommonQueryParams) Complete()

func (CommonQueryParams) Kind

type Commoner

type Commoner interface {
	Common() (*CommonQuery, error)
}

type CompleteClause

type CompleteClause interface {
	Clause
	Complete()
}

type CompleteClauser

type CompleteClauser interface {
	CompleteClause
	Clause() (QueryClause, error)
}

type CompleteFuzzier

type CompleteFuzzier interface {
	Fuzzier
	CompleteClause
}

type CompleteMatcher

type CompleteMatcher interface {
	Matcher
	CompleteClauser
}

type CompletePrefixer

type CompletePrefixer interface {
	Prefixer
	CompleteClauser
}

type CompleteTermer

type CompleteTermer interface {
	Termer
	CompleteClauser
}

type CompleteTermser

type CompleteTermser interface {
	Termser
	CompleteClauser
}

type CompletionField

type CompletionField struct {
	// contains filtered or unexported fields
}

The CompletionField is a completion suggester which provides provides auto-complete/search-as-you-type functionality. This is a navigational feature to guide users to relevant results as they are typing, improving search precision. It is not meant for spell correction or did-you-mean functionality like the term or phrase suggesters.

Ideally, auto-complete functionality should be as fast as a user types to provide instant feedback relevant to what a user has already typed in. Hence, completion suggester is optimized for speed. The suggester uses data structures that enable fast lookups, but are costly to build and are stored in-memory.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester

func NewCompletionField

func NewCompletionField(params CompletionFieldParams) (*CompletionField, error)

func (CompletionField) Analyzer

func (ap CompletionField) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (*CompletionField) Field

func (c *CompletionField) Field() (Field, error)

func (CompletionField) MarshalBSON

func (c CompletionField) MarshalBSON() ([]byte, error)

func (CompletionField) MarshalJSON

func (c CompletionField) MarshalJSON() ([]byte, error)

func (CompletionField) MaxInputLength

func (mil CompletionField) MaxInputLength() int

MaxInputLength limits the length of a single input, defaults to 50 UTF-16 code points. This limit is only used at index time to reduce the total number of characters per input string in order to prevent massive inputs from bloating the underlying datastructure. Most use cases won’t be influenced by the default value since prefix completions seldom grow beyond prefixes longer than a handful of characters.

func (CompletionField) PreservePositionIncrements

func (ppi CompletionField) PreservePositionIncrements() bool

PreservePositionIncrements enables position increments, defaults to true. If disabled and using stopwords analyzer, you could get a field starting with The Beatles, if you suggest for b. Note: You could also achieve this by indexing two inputs, Beatles and The Beatles, no need to change a simple analyzer, if you are able to enrich your data.

func (CompletionField) PreserveSeperators

func (ps CompletionField) PreserveSeperators() bool

PreserveSeperators preserves the separators, defaults to true. If disabled, you could find a field starting with Foo Fighters, if you suggest for foof.

func (CompletionField) SearchAnalyzer

func (sa CompletionField) SearchAnalyzer() string

SearchAnalyzer overrides Analyzer for search analysis

func (CompletionField) SearchQuoteAnalyzer

func (sq CompletionField) SearchQuoteAnalyzer() string

SearchQuoteAnalyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

func (*CompletionField) SetAnalyzer

func (ap *CompletionField) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*CompletionField) SetMaxInputLength

func (mil *CompletionField) SetMaxInputLength(v interface{}) error

SetMaxInputLength sets the MaxInputLength value to v

func (*CompletionField) SetPreservePositionIncrements

func (ppi *CompletionField) SetPreservePositionIncrements(v interface{}) error

SetPreservePositionIncrements sets the PreservePositionIncrements value to V

func (*CompletionField) SetPreserveSeperators

func (ps *CompletionField) SetPreserveSeperators(v interface{}) error

SetPreserveSeperators sets the preserve_seperator to v

func (*CompletionField) SetSearchAnalyzer

func (sa *CompletionField) SetSearchAnalyzer(v string)

SetSearchAnalyzer sets search_analyzer to v

func (CompletionField) SetSearchQuoteAnalyzer

func (sq CompletionField) SetSearchQuoteAnalyzer(v string)

SetSearchQuoteAnalyzer sets search_quote_analyzer to v

func (CompletionField) Type

func (CompletionField) Type() FieldType

func (*CompletionField) UnmarshalBSON

func (c *CompletionField) UnmarshalBSON(data []byte) error

func (*CompletionField) UnmarshalJSON

func (c *CompletionField) UnmarshalJSON(data []byte) error

type CompletionFieldParams

type CompletionFieldParams struct {
	// Analyzer used to convert the text in the query value into tokens.
	// Defaults to the index-time analyzer mapped for the <field>. If no
	// analyzer is mapped, the index’s default analyzer is used. (Optional)
	Analyzer string `json:"analyzer,omitempty"`
	// SearchAnalyzer overrides Analyzer for search analysis. (Optional)
	SearchAnalyzer string `json:"search_analyzer,omitempty"`
	// SearchQuoteAnalyzer setting allows you to specify an analyzer for
	// phrases, this is particularly useful when dealing with disabling stop
	// words for phrase queries. (Optional)
	SearchQuoteAnalyzer string `json:"search_quote_analyzer,omitempty"`
	// PreserveSeperators preserves the separators, defaults to true. If
	// disabled, you could find a field starting with Foo Fighters, if you
	// suggest for foof.
	PreserveSeperators interface{} `json:"preserve_separators,omitempty"`

	// Enables position increments, defaults to true. If disabled and using
	// stopwords analyzer, you could get a field starting with The Beatles, if you
	// suggest for b. Note: You could also achieve this by indexing two inputs,
	// Beatles and The Beatles, no need to change a simple analyzer, if you are able
	// to enrich your data.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester
	PreservePositionIncrements interface{} `json:"preserve_position_increments,omitempty"`
	// MaxInputLength limits the length of a single input, defaults to 50 UTF-16
	// code points. This limit is only used at index time to reduce the total
	// number of characters per input string in order to prevent massive inputs
	// from bloating the underlying datastructure. Most use cases won’t be
	// influenced by the default value since prefix completions seldom grow
	// beyond prefixes longer than a handful of characters.
	MaxInputLength interface{} `json:"max_input_length,omitempty"`
}

CompletionFieldParams creates a completion_field. A completion_field is a completion suggester which provides provides auto-complete/search-as-you-type functionality. This is a navigational feature to guide users to relevant results as they are typing, improving search precision. It is not meant for spell correction or did-you-mean functionality like the term or phrase suggesters.

Ideally, auto-complete functionality should be as fast as a user types to provide instant feedback relevant to what a user has already typed in. Hence, completion suggester is optimized for speed. The suggester uses data structures that enable fast lookups, but are costly to build and are stored in-memory.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester

func (CompletionFieldParams) Completion

func (p CompletionFieldParams) Completion() (*CompletionField, error)

func (CompletionFieldParams) Field

func (p CompletionFieldParams) Field() (Field, error)

func (CompletionFieldParams) Type

type Completioner

type Completioner interface {
	Completion() (*CompletionField, error)
}

type Conflicts

type Conflicts string

type ConstantField

type ConstantField struct {
	// contains filtered or unexported fields
}

ConstantField is a specialization of the Keyword field for the case that all documentsin the index have the same value.

! X-Pack

https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#constant-keyword-field-type

func NewConstantField

func NewConstantField(params ConstantFieldParams) (*ConstantField, error)

func (*ConstantField) Field

func (c *ConstantField) Field() (Field, error)

func (ConstantField) MarshalBSON

func (c ConstantField) MarshalBSON() ([]byte, error)

func (ConstantField) MarshalJSON

func (c ConstantField) MarshalJSON() ([]byte, error)

func (ConstantField) SetValue

func (c ConstantField) SetValue(v interface{})

func (ConstantField) Type

func (ConstantField) Type() FieldType

func (*ConstantField) UnmarshalBSON

func (c *ConstantField) UnmarshalBSON(data []byte) error

func (*ConstantField) UnmarshalJSON

func (c *ConstantField) UnmarshalJSON(data []byte) error

func (*ConstantField) Value

func (c *ConstantField) Value() interface{}

type ConstantFieldParams

type ConstantFieldParams struct {
	Value interface{} `json:"value"`
}

func (ConstantFieldParams) ConstantField

func (c ConstantFieldParams) ConstantField() (*ConstantField, error)

func (ConstantFieldParams) Field

func (c ConstantFieldParams) Field() (Field, error)

func (ConstantFieldParams) Type

type ConstantFielder

type ConstantFielder interface {
	ConstantField() (*ConstantField, error)
}

type ConstantScoreQuery

type ConstantScoreQuery struct {
	// contains filtered or unexported fields
}

func (ConstantScoreQuery) Boost

func (b ConstantScoreQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*ConstantScoreQuery) Clause

func (cs *ConstantScoreQuery) Clause() (QueryClause, error)

func (*ConstantScoreQuery) Clear

func (cs *ConstantScoreQuery) Clear()

func (ConstantScoreQuery) Complete

func (ConstantScoreQuery) Complete()

func (*ConstantScoreQuery) ConstantScore

func (cs *ConstantScoreQuery) ConstantScore() (*ConstantScoreQuery, error)

func (*ConstantScoreQuery) Filter

func (cs *ConstantScoreQuery) Filter() *Query

func (*ConstantScoreQuery) IsEmpty

func (cs *ConstantScoreQuery) IsEmpty() bool

func (ConstantScoreQuery) Kind

func (ConstantScoreQuery) MarshalJSON

func (cs ConstantScoreQuery) MarshalJSON() ([]byte, error)

func (ConstantScoreQuery) Name

func (n ConstantScoreQuery) Name() string

func (*ConstantScoreQuery) SetBoost

func (b *ConstantScoreQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*ConstantScoreQuery) SetFilter

func (cs *ConstantScoreQuery) SetFilter(query Querier) error

func (*ConstantScoreQuery) SetName

func (n *ConstantScoreQuery) SetName(name string)

func (*ConstantScoreQuery) UnmarshalJSON

func (cs *ConstantScoreQuery) UnmarshalJSON(data []byte) error

type ConstantScoreQueryParams

type ConstantScoreQueryParams struct {
	// (Required) Filter query you wish to run. Any returned
	// documents must match this query.
	//
	// Filter queries do not calculate relevance scores. To speed up
	// performance, Elasticsearch automatically caches frequently used filter
	// queries.
	Filter Querier
	// (Optional, float) Floating point number used as the constant relevance score for every document matching the filter query. Defaults to 1.0.
	Boost interface{}
}

func (ConstantScoreQueryParams) Clause

func (ConstantScoreQueryParams) ConstantScore

func (p ConstantScoreQueryParams) ConstantScore() (*ConstantScoreQuery, error)

func (ConstantScoreQueryParams) Kind

type ConstantScorer

type ConstantScorer interface {
	ConstantScore() (*ConstantScoreQuery, error)
}

type CopyToParam

type CopyToParam struct {
	CopyToValue string `bson:"copy_to,omitempty" json:"copy_to,omitempty"`
}

CopyToParam is a Field mixin for CopyTo

The copy_to parameter allows you to copy the values of multiple fields into a group field, which can then be queried as a single field.

https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html

func (CopyToParam) CopyTo

func (ctp CopyToParam) CopyTo() string

CopyTo parameter allows you to copy the values of multiple fields into a group field, which can then be queried as a single field.

func (*CopyToParam) SetCopyTo

func (ctp *CopyToParam) SetCopyTo(v string)

SetCopyTo sets CopyToParam.Value to v

type Count

type Count struct {
	// contains filtered or unexported fields
}

func NewCount

func NewCount(params CountParams) (*Count, error)

func (Count) Encode

func (c Count) Encode() (*bytes.Buffer, error)

func (Count) MarshalBSON

func (c Count) MarshalBSON() ([]byte, error)

func (Count) MarshalJSON

func (c Count) MarshalJSON() ([]byte, error)

func (*Count) Query

func (c *Count) Query() *Query

func (*Count) UnmarshalBSON

func (c *Count) UnmarshalBSON(data []byte) error

func (*Count) UnmarshalJSON

func (c *Count) UnmarshalJSON(data []byte) error

type CountParams

type CountParams struct {
	Query Querier
}

func (CountParams) Count

func (p CountParams) Count() (*Count, error)

type Counter

type Counter interface {
	Count() (*Count, error)
}

type DateField

type DateField struct {
	// contains filtered or unexported fields
}

func NewDateField

func NewDateField(params DateFieldParams) (*DateField, error)

func (DateField) Boost

func (b DateField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (DateField) DocValues

func (dv DateField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*DateField) Field

func (d *DateField) Field() (Field, error)

func (DateField) Format

func (f DateField) Format() string

Format is the format(s) that the that can be parsed. Defaults to strict_date_optional_time||epoch_millis.

Multiple formats can be seperated by ||

func (DateField) IgnoreMalformed

func (im DateField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (DateField) Index

func (i DateField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (DateField) MarshalBSON

func (d DateField) MarshalBSON() ([]byte, error)

func (DateField) MarshalJSON

func (d DateField) MarshalJSON() ([]byte, error)

func (DateField) Meta

func (m DateField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (DateField) NullValue

func (nv DateField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*DateField) SetBoost

func (b *DateField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*DateField) SetDocValues

func (dv *DateField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*DateField) SetFormat

func (f *DateField) SetFormat(v string)

func (*DateField) SetIgnoreMalformed

func (im *DateField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*DateField) SetIndex

func (i *DateField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*DateField) SetMeta

func (m *DateField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*DateField) SetNullValue

func (nv *DateField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*DateField) SetStore

func (sa *DateField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (DateField) Store

func (sa DateField) Store() bool

Store returns the StoreAttr Value or false

func (DateField) Type

func (DateField) Type() FieldType

func (*DateField) UnmarshalBSON

func (d *DateField) UnmarshalBSON(data []byte) error

func (*DateField) UnmarshalJSON

func (d *DateField) UnmarshalJSON(data []byte) error

type DateFieldParams

type DateFieldParams struct {
	// IgnoreMalformed determines if malformed numbers are ignored. If true,
	// malformed numbers are ignored. If false (default), malformed numbers
	// throw an exception and reject the whole document.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// (Optional, bool, default: true)
	//
	// Most fields are indexed by default, which makes them searchable. The
	// inverted index allows queries to look up the search term in unique sorted
	// list of terms, and from that immediately have access to the list of
	// documents that contain the term.
	//
	// Sorting, aggregations, and access to field values in scripts requires a
	// different data access pattern. Instead of looking up the term and finding
	// documents, we need to be able to look up the document and find the terms
	// that it has in a field.
	//
	// Doc values are the on-disk data structure, built at document index time,
	// which makes this data access pattern possible. They store the same values
	// as the _source but in a column-oriented fashion that is way more
	// efficient for sorting and aggregations. Doc values are supported on
	// almost all field types, with the notable exception of text and
	// annotated_text fields.
	//
	// All fields which support doc values have them enabled by default. If you
	// are sure that you don’t need to sort or aggregate on a field, or access
	// the field value from a script, you can disable doc values in order to
	// save disk space
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
	DocValues interface{} `json:"doc_values,omitempty"`
	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool)
	Index interface{} `json:"index,omitempty"`
	// NullValue parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	NullValue interface{} `json:"null_value,omitempty"`
	// WithStore is a mapping with a store paramter.
	//
	// By default, field values are indexed to make them searchable, but they
	// are not stored. This means that the field can be queried, but the
	// original field value cannot be retrieved.
	//
	// Usually this doesn’t matter. The field value is already part of the
	// _source field, which is stored by default. If you only want to retrieve
	// the value of a single field or of a few fields, instead of the whole
	// _source, then this can be achieved with source filtering.
	//
	// In certain situations it can make sense to store a field. For instance,
	// if you have a document with a title, a date, and a very large content
	// field, you may want to retrieve just the title and the date without
	// having to extract those fields from a large _source field
	//
	// Stored fields returned as arrays
	//
	// For consistency, stored fields are always returned as an array because
	// there is no way of knowing if the original field value was a single
	// value, multiple values, or an empty array.
	//
	// The original value can be retrieved from the _source field instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
	Store interface{} `json:"store,omitempty"`
	// Metadata attached to the field. This metadata is opaque to Elasticsearch,
	// it is only useful for multiple applications that work on the same indices
	// to share meta information about fields such as units
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-field-meta.html#mapping-field-meta
	Meta Meta `json:"meta,omitempty"`
	//Format is the format(d) that the that can be parsed. Defaults to
	//strict_date_optional_time||epoch_millis.
	//
	// Multiple formats can be seperated by ||
	Format string `json:"format,omitempty"`

	// Deprecated
	Boost interface{} `json:"boost,omitempty"`
}

func (DateFieldParams) Date

func (p DateFieldParams) Date() (*DateField, error)

func (DateFieldParams) Field

func (p DateFieldParams) Field() (Field, error)

func (DateFieldParams) Type

func (DateFieldParams) Type() FieldType

type DateNanoSecField

type DateNanoSecField struct {
	// contains filtered or unexported fields
}

DateNanoSecField is an addition to the DateField data type.

However there is an important distinction between the two. The existing date data type stores dates in millisecond resolution. The date_nanos data type stores dates in nanosecond resolution, which limits its range of dates from roughly 1970 to 2262, as dates are still stored as a long representing nanoseconds since the epoch.

Queries on nanoseconds are internally converted to range queries on this long representation, and the result of aggregations and stored fields is converted back to a string depending on the date format that is associated with the field.

Date formats can be customised, but if no format is specified then it uses the default:

"strict_date_optional_time||epoch_millis"

This means that it will accept dates with optional timestamps, which conform to the formats supported by strict_date_optional_time including up to nine second fractionals or milliseconds-since-the-epoch (thus losing precision on the nano second part). Using strict_date_optional_time will format the result up to only three second fractionals. To print and parse up to nine digits of resolution, use strict_date_optional_time_nanos.

Limitations

Aggregations are still on millisecond resolution, even when using a date_nanos field. This limitation also affects transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/date_nanos.html

func NewDateNanoSecField

func NewDateNanoSecField(params DateNanoSecFieldParams) (*DateNanoSecField, error)

func (DateNanoSecField) Boost

func (b DateNanoSecField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (DateNanoSecField) DocValues

func (dv DateNanoSecField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*DateNanoSecField) Field

func (d *DateNanoSecField) Field() (Field, error)

func (DateNanoSecField) Format

func (f DateNanoSecField) Format() string

Format is the format(s) that the that can be parsed. Defaults to strict_date_optional_time||epoch_millis.

Multiple formats can be seperated by ||

func (DateNanoSecField) IgnoreMalformed

func (im DateNanoSecField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (DateNanoSecField) Index

func (i DateNanoSecField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (DateNanoSecField) MarshalBSON

func (d DateNanoSecField) MarshalBSON() ([]byte, error)

func (DateNanoSecField) MarshalJSON

func (d DateNanoSecField) MarshalJSON() ([]byte, error)

func (DateNanoSecField) Meta

func (m DateNanoSecField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (DateNanoSecField) NullValue

func (nv DateNanoSecField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*DateNanoSecField) SetBoost

func (b *DateNanoSecField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*DateNanoSecField) SetDocValues

func (dv *DateNanoSecField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*DateNanoSecField) SetFormat

func (f *DateNanoSecField) SetFormat(v string)

func (*DateNanoSecField) SetIgnoreMalformed

func (im *DateNanoSecField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*DateNanoSecField) SetIndex

func (i *DateNanoSecField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*DateNanoSecField) SetMeta

func (m *DateNanoSecField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*DateNanoSecField) SetNullValue

func (nv *DateNanoSecField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*DateNanoSecField) SetStore

func (sa *DateNanoSecField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (DateNanoSecField) Store

func (sa DateNanoSecField) Store() bool

Store returns the StoreAttr Value or false

func (DateNanoSecField) Type

func (d DateNanoSecField) Type() FieldType

func (*DateNanoSecField) UnmarshalBSON

func (d *DateNanoSecField) UnmarshalBSON(data []byte) error

func (*DateNanoSecField) UnmarshalJSON

func (d *DateNanoSecField) UnmarshalJSON(data []byte) error

type DateNanoSecFieldParams

type DateNanoSecFieldParams DateFieldParams

func (DateNanoSecFieldParams) DateNanoSec

func (p DateNanoSecFieldParams) DateNanoSec() (*DateNanoSecField, error)

func (DateNanoSecFieldParams) Field

func (p DateNanoSecFieldParams) Field() (Field, error)

func (DateNanoSecFieldParams) Type

type DateRangeField

type DateRangeField struct {
	// contains filtered or unexported fields
}

DateRangeField is a range of date values. Date ranges support various date formats through the format mapping parameter. Regardless of the format used, date values are parsed into an unsigned 64-bit integer representing milliseconds since the Unix epoch in UTC. Values containing the now date math expression are not supported.

func NewDateRangeField

func NewDateRangeField(params DateRangeFieldParams) (*DateRangeField, error)

func (DateRangeField) Coerce

func (cp DateRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*DateRangeField) Field

func (r *DateRangeField) Field() (Field, error)

func (DateRangeField) Format

func (f DateRangeField) Format() string

Format is the format(s) that the that can be parsed. Defaults to strict_date_optional_time||epoch_millis.

Multiple formats can be seperated by ||

func (DateRangeField) Index

func (i DateRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (DateRangeField) MarshalBSON

func (r DateRangeField) MarshalBSON() ([]byte, error)

func (DateRangeField) MarshalJSON

func (r DateRangeField) MarshalJSON() ([]byte, error)

func (*DateRangeField) SetCoerce

func (cp *DateRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*DateRangeField) SetFormat

func (f *DateRangeField) SetFormat(v string)

func (*DateRangeField) SetIndex

func (i *DateRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*DateRangeField) SetStore

func (sa *DateRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (DateRangeField) Store

func (sa DateRangeField) Store() bool

Store returns the StoreAttr Value or false

func (DateRangeField) Type

func (DateRangeField) Type() FieldType

func (*DateRangeField) UnmarshalBSON

func (r *DateRangeField) UnmarshalBSON(data []byte) error

func (*DateRangeField) UnmarshalJSON

func (r *DateRangeField) UnmarshalJSON(data []byte) error

type DateRangeFieldParams

type DateRangeFieldParams struct {
	// Coercion attempts to clean up dirty values to fit the data type of a
	// field. (Optional, bool) Defaults to false.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/coerce.html
	Coerce interface{} `json:"coerce,omitempty"`
	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool)
	Index interface{} `json:"index,omitempty"`
	// WithStore is a mapping with a store paramter.
	//
	// By default, field values are indexed to make them searchable, but they are
	// not stored. This means that the field can be queried, but the original field
	// value cannot be retrieved.
	//
	// Usually this doesn’t matter. The field value is already part of the _source
	// field, which is stored by default. If you only want to retrieve the value of
	// a single field or of a few fields, instead of the whole _source, then this
	// can be achieved with source filtering.
	//
	// In certain situations it can make sense to store a field. For instance, if
	// you have a document with a title, a date, and a very large content field, you
	// may want to retrieve just the title and the date without having to extract
	// those fields from a large _source field
	//
	// Stored fields returned as arrays
	//
	// For consistency, stored fields are always returned as an array because there
	// is no way of knowing if the original field value was a single value, multiple
	// values, or an empty array.
	//
	// The original value can be retrieved from the _source field instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
	Store  interface{} `json:"store,omitempty"`
	Format string      `json:"format,omitempty"`
}

func (DateRangeFieldParams) DateRange

func (p DateRangeFieldParams) DateRange() (*DateRangeField, error)

func (DateRangeFieldParams) Field

func (p DateRangeFieldParams) Field() (Field, error)

func (DateRangeFieldParams) Type

type DecayFunction

type DecayFunction interface {
	Function
	Field() string
	Origin() interface{}
	SetOrigin(interface{}) error
	Offset() dynamic.StringNumberOrTime
	SetOffset(interface{}) error
	Scale() dynamic.StringOrNumber
	SetScale(interface{}) error
	SetField(string) error
	Decay() dynamic.Number
	SetDecay(v interface{}) error
}

type DeleteByQuerier

type DeleteByQuerier interface {
	DeleteByQuery() (*DeleteByQuery, error)
}

type DeleteByQuery

type DeleteByQuery struct {
	// contains filtered or unexported fields
}

func NewDeleteByQuery

func NewDeleteByQuery(params DeleteByQueryParams) (*DeleteByQuery, error)

func (DeleteByQuery) Encode

func (d DeleteByQuery) Encode() (*bytes.Buffer, error)

func (DeleteByQuery) MarshalBSON

func (d DeleteByQuery) MarshalBSON() ([]byte, error)

func (DeleteByQuery) MarshalJSON

func (d DeleteByQuery) MarshalJSON() ([]byte, error)

func (*DeleteByQuery) Query

func (d *DeleteByQuery) Query() *Query

func (*DeleteByQuery) UnmarshalBSON

func (d *DeleteByQuery) UnmarshalBSON(data []byte) error

func (*DeleteByQuery) UnmarshalJSON

func (d *DeleteByQuery) UnmarshalJSON(data []byte) error

type DeleteByQueryParams

type DeleteByQueryParams struct {
	Query Querier
}

func (DeleteByQueryParams) DeleteByQuery

func (p DeleteByQueryParams) DeleteByQuery() (*DeleteByQuery, error)

type DeleteByQueryResponse

type DeleteByQueryResponse struct {
	Took                 int64         `json:"took"`
	TimedOut             bool          `json:"timed_out"`
	Total                int64         `json:"total"`
	Updated              int64         `json:"updated"`
	Deleted              int64         `json:"deleted"`
	Batches              int64         `json:"batches"`
	VersionConflicts     int64         `json:"version_conflicts"`
	Noops                int64         `json:"noops"`
	Retries              Retries       `json:"retries"`
	ThrottledMillis      int64         `json:"throttled_millis"`
	RequestsPerSecond    float64       `json:"requests_per_second"`
	Failures             []interface{} `json:"failures"`
	ThrottledUntilMillis int64         `json:"throttled_until_millis"`
}

func DecodeDeleteByQueryResponse

func DecodeDeleteByQueryResponse(body io.Reader) (*DeleteByQueryResponse, error)

type DenseVectorField

type DenseVectorField struct {
	// contains filtered or unexported fields
}

DenseVectorField stores dense vectors of float values. The maximum number of dimensions that can be in a vector should not exceed 2048. A dense_vector field is a single-valued field.

! X-Pack

These vectors can be used for document scoring. For example, a document score can represent a distance between a given query vector and the indexed document vector.

You index a dense vector as an array of floats.

https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html

func NewDenseVectorField

func NewDenseVectorField(params DenseVectorFieldParams) (*DenseVectorField, error)

func (DenseVectorField) Dimensions

func (d DenseVectorField) Dimensions() int

func (*DenseVectorField) Field

func (dv *DenseVectorField) Field() (Field, error)

func (DenseVectorField) MarshalJSON

func (dv DenseVectorField) MarshalJSON() ([]byte, error)

func (*DenseVectorField) SetDimensions

func (d *DenseVectorField) SetDimensions(v interface{}) error

func (DenseVectorField) Type

func (DenseVectorField) Type() FieldType

func (*DenseVectorField) UnmarshalJSON

func (dv *DenseVectorField) UnmarshalJSON(data []byte) error

type DenseVectorFieldParams

type DenseVectorFieldParams struct {
	// Dimensions is the number of dimensions in the vector, required parameter.
	Dimensions interface{} `json:"dims,omitempty"`
}

func (DenseVectorFieldParams) DenseVector

func (p DenseVectorFieldParams) DenseVector() (*DenseVectorField, error)

func (DenseVectorFieldParams) Field

func (p DenseVectorFieldParams) Field() (Field, error)

func (DenseVectorFieldParams) Type

type DisjunctionMaxQuery

type DisjunctionMaxQuery struct {
	// contains filtered or unexported fields
}

func (*DisjunctionMaxQuery) Clause

func (dm *DisjunctionMaxQuery) Clause() (QueryClause, error)

func (*DisjunctionMaxQuery) Clear

func (dm *DisjunctionMaxQuery) Clear()

func (DisjunctionMaxQuery) Complete

func (DisjunctionMaxQuery) Complete()

func (*DisjunctionMaxQuery) DisjunectionMax

func (dm *DisjunctionMaxQuery) DisjunectionMax() (*DisjunctionMaxQuery, error)

func (*DisjunctionMaxQuery) IsEmpty

func (dm *DisjunctionMaxQuery) IsEmpty() bool

func (DisjunctionMaxQuery) Kind

func (DisjunctionMaxQuery) MarshalJSON

func (dm DisjunctionMaxQuery) MarshalJSON() ([]byte, error)

func (DisjunctionMaxQuery) Name

func (n DisjunctionMaxQuery) Name() string

func (DisjunctionMaxQuery) Queries

func (dm DisjunctionMaxQuery) Queries() Queries

func (*DisjunctionMaxQuery) SetName

func (n *DisjunctionMaxQuery) SetName(name string)

func (*DisjunctionMaxQuery) SetQueries

func (dm *DisjunctionMaxQuery) SetQueries(queries Queryset) error

func (*DisjunctionMaxQuery) SetTieBreaker

func (dm *DisjunctionMaxQuery) SetTieBreaker(v float64) error

func (DisjunctionMaxQuery) TieBreaker

func (dm DisjunctionMaxQuery) TieBreaker() float64

func (*DisjunctionMaxQuery) UnmarshalJSON

func (dm *DisjunctionMaxQuery) UnmarshalJSON(data []byte) error

type DisjunctionMaxQueryParams

type DisjunctionMaxQueryParams struct {
	Queries    Queriers
	TieBreaker float64
	Name       string
}

func (DisjunctionMaxQueryParams) Clause

func (DisjunctionMaxQueryParams) DisjunctionMax

func (p DisjunctionMaxQueryParams) DisjunctionMax() (*DisjunctionMaxQuery, error)

func (DisjunctionMaxQueryParams) Kind

type DisjunctionMaxer

type DisjunctionMaxer interface {
	DisjunctionMax() (*DisjunctionMaxQuery, error)
}

type DistanceFeatureQuery

type DistanceFeatureQuery struct {
	// contains filtered or unexported fields
}

func (DistanceFeatureQuery) Boost

func (b DistanceFeatureQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*DistanceFeatureQuery) Clause

func (q *DistanceFeatureQuery) Clause() (QueryClause, error)

func (*DistanceFeatureQuery) Clear

func (q *DistanceFeatureQuery) Clear()

func (DistanceFeatureQuery) Complete

func (DistanceFeatureQuery) Complete()

func (*DistanceFeatureQuery) DistanceFeature

func (q *DistanceFeatureQuery) DistanceFeature() (*DistanceFeatureQuery, error)

func (DistanceFeatureQuery) Field

func (f DistanceFeatureQuery) Field() string

func (*DistanceFeatureQuery) IsEmpty

func (q *DistanceFeatureQuery) IsEmpty() bool

func (DistanceFeatureQuery) Kind

func (DistanceFeatureQuery) MarshalBSON

func (q DistanceFeatureQuery) MarshalBSON() ([]byte, error)

func (DistanceFeatureQuery) MarshalJSON

func (q DistanceFeatureQuery) MarshalJSON() ([]byte, error)

func (DistanceFeatureQuery) Name

func (n DistanceFeatureQuery) Name() string

func (DistanceFeatureQuery) Origin

func (q DistanceFeatureQuery) Origin() string

func (DistanceFeatureQuery) Pivot

func (q DistanceFeatureQuery) Pivot() string

func (*DistanceFeatureQuery) SetBoost

func (b *DistanceFeatureQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*DistanceFeatureQuery) SetField

func (f *DistanceFeatureQuery) SetField(field string) error

func (*DistanceFeatureQuery) SetName

func (n *DistanceFeatureQuery) SetName(name string)

func (*DistanceFeatureQuery) SetOrigin

func (q *DistanceFeatureQuery) SetOrigin(origin string) error

func (*DistanceFeatureQuery) SetPivot

func (q *DistanceFeatureQuery) SetPivot(pivot string) error

func (*DistanceFeatureQuery) UnmarshalBSON

func (q *DistanceFeatureQuery) UnmarshalBSON(data []byte) error

func (*DistanceFeatureQuery) UnmarshalJSON

func (q *DistanceFeatureQuery) UnmarshalJSON(data []byte) error

type DistanceFeatureQueryParams

type DistanceFeatureQueryParams struct {
	Name string
	// (Required, string) Name of the field used to calculate distances.
	//
	// This field must meet the following criteria:
	//
	// - Be a date, date_nanos or geo_point field
	//
	// - Have an index mapping parameter value of true, which is the default
	//
	// - Have an doc_values mapping parameter value of true, which is the
	// default
	Field string
	// (Required, string) Date or point of origin used to calculate distances.
	//
	// If the field value is a date or date_nanos field, the origin value must
	// be a date. Date Math, such as now-1h, is supported.
	//
	// If the field value is a geo_point field, the origin value must be a
	// geopoint.
	Origin string

	// (Required, time unit or distance unit) Distance from the origin at which
	// relevance scores receive half of the boost value.
	//
	// If the field value is a date or date_nanos field, the pivot value must be a
	// time unit, such as 1h or 10d.
	//
	// If the field value is a geo_point field, the pivot value must be a distance
	// unit, such as 1km or 12m.
	Pivot string

	// (Optional, float) Floating point number used to multiply the relevance
	// score of matching documents. This value cannot be negative. Defaults to
	// 1.0.
	Boost interface{}
	// contains filtered or unexported fields
}

func (DistanceFeatureQueryParams) Clause

func (DistanceFeatureQueryParams) Complete

func (DistanceFeatureQueryParams) Complete()

func (DistanceFeatureQueryParams) DistanceFeature

func (p DistanceFeatureQueryParams) DistanceFeature() (*DistanceFeatureQuery, error)

func (DistanceFeatureQueryParams) Kind

type DistanceFeaturer

type DistanceFeaturer interface {
	DistanceFeature() (*DistanceFeatureQuery, error)
}

type DistanceType

type DistanceType string

type DoubleField

type DoubleField struct {
	// contains filtered or unexported fields
}

A DoubleField is a double-precision 64-bit IEEE 754 floating point number, restricted to finite values.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewDoubleField

func NewDoubleField(params DoubleFieldParams) (*DoubleField, error)

func (DoubleField) Boost

func (b DoubleField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (DoubleField) Coerce

func (cp DoubleField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (DoubleField) DocValues

func (dv DoubleField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*DoubleField) Field

func (d *DoubleField) Field() (Field, error)

func (DoubleField) IgnoreMalformed

func (im DoubleField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (DoubleField) Index

func (i DoubleField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (DoubleField) MarshalBSON

func (d DoubleField) MarshalBSON() ([]byte, error)

func (DoubleField) MarshalJSON

func (d DoubleField) MarshalJSON() ([]byte, error)

func (DoubleField) Meta

func (m DoubleField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (DoubleField) NullValue

func (nv DoubleField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*DoubleField) SetBoost

func (b *DoubleField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*DoubleField) SetCoerce

func (cp *DoubleField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*DoubleField) SetDocValues

func (dv *DoubleField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*DoubleField) SetIgnoreMalformed

func (im *DoubleField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*DoubleField) SetIndex

func (i *DoubleField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*DoubleField) SetMeta

func (m *DoubleField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*DoubleField) SetNullValue

func (nv *DoubleField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*DoubleField) SetStore

func (sa *DoubleField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (DoubleField) Store

func (sa DoubleField) Store() bool

Store returns the StoreAttr Value or false

func (DoubleField) Type

func (DoubleField) Type() FieldType

func (*DoubleField) UnmarshalBSON

func (d *DoubleField) UnmarshalBSON(data []byte) error

func (*DoubleField) UnmarshalJSON

func (d *DoubleField) UnmarshalJSON(data []byte) error

type DoubleFieldParams

type DoubleFieldParams numberFieldParams

func (DoubleFieldParams) Double

func (d DoubleFieldParams) Double() (*DoubleField, error)

func (DoubleFieldParams) Field

func (d DoubleFieldParams) Field() (Field, error)

func (DoubleFieldParams) Type

type DoubleRangeField

type DoubleRangeField struct {
	// contains filtered or unexported fields
}

DoubleRangeField is a range of double-precision 64-bit IEEE 754 floating point values.

func NewDoubleRangeField

func NewDoubleRangeField(params DoubleRangeFieldParams) (*DoubleRangeField, error)

func (DoubleRangeField) Coerce

func (cp DoubleRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*DoubleRangeField) Field

func (r *DoubleRangeField) Field() (Field, error)

func (DoubleRangeField) Index

func (i DoubleRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (DoubleRangeField) MarshalBSON

func (r DoubleRangeField) MarshalBSON() ([]byte, error)

func (DoubleRangeField) MarshalJSON

func (r DoubleRangeField) MarshalJSON() ([]byte, error)

func (*DoubleRangeField) SetCoerce

func (cp *DoubleRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*DoubleRangeField) SetIndex

func (i *DoubleRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*DoubleRangeField) SetStore

func (sa *DoubleRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (DoubleRangeField) Store

func (sa DoubleRangeField) Store() bool

Store returns the StoreAttr Value or false

func (DoubleRangeField) Type

func (DoubleRangeField) Type() FieldType

func (*DoubleRangeField) UnmarshalBSON

func (r *DoubleRangeField) UnmarshalBSON(data []byte) error

func (*DoubleRangeField) UnmarshalJSON

func (r *DoubleRangeField) UnmarshalJSON(data []byte) error

type DoubleRangeFieldParams

type DoubleRangeFieldParams rangeFieldParams

func (DoubleRangeFieldParams) DoubleRange

func (p DoubleRangeFieldParams) DoubleRange() (*DoubleRangeField, error)

func (DoubleRangeFieldParams) Field

func (p DoubleRangeFieldParams) Field() (Field, error)

func (DoubleRangeFieldParams) Type

type Dynamic

type Dynamic string
const (
	DynamicUnspecified Dynamic = ""
	DynamicTrue        Dynamic = "true"
	DynamicFalse       Dynamic = "false"
	DynamicRuntime     Dynamic = "runtime"
	DynamicStrict      Dynamic = "strict"
)

func (*Dynamic) IsValid

func (d *Dynamic) IsValid() bool

func (Dynamic) String

func (d Dynamic) String() string

func (*Dynamic) Validate

func (d *Dynamic) Validate() error

type Exister

type Exister interface {
	Exists() (*ExistsQuery, error)
}

type ExistsQuery

type ExistsQuery struct {
	// contains filtered or unexported fields
}

ExistsQuery returns documents that contain an indexed value for a field.

An indexed value may not exist for a document’s field due to a variety of reasons:

- The field in the source JSON is null or []

- The field has "index" : false set in the mapping

- The length of the field value exceeded an ignore_above setting in the mapping

- The field value was malformed and ignore_malformed was defined in the mapping

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html

func (*ExistsQuery) Clause

func (e *ExistsQuery) Clause() (QueryClause, error)

func (*ExistsQuery) Clear

func (e *ExistsQuery) Clear()

func (ExistsQuery) Complete

func (ExistsQuery) Complete()

func (*ExistsQuery) Field

func (e *ExistsQuery) Field() string

func (*ExistsQuery) IsEmpty

func (e *ExistsQuery) IsEmpty() bool

func (ExistsQuery) Kind

func (e ExistsQuery) Kind() QueryKind

func (ExistsQuery) MarshalBSON

func (e ExistsQuery) MarshalBSON() ([]byte, error)

func (ExistsQuery) MarshalJSON

func (e ExistsQuery) MarshalJSON() ([]byte, error)

func (ExistsQuery) Name

func (n ExistsQuery) Name() string

func (*ExistsQuery) Set

func (e *ExistsQuery) Set(field string, exists Exister) error

func (*ExistsQuery) SetField

func (e *ExistsQuery) SetField(field string) error

func (*ExistsQuery) SetName

func (n *ExistsQuery) SetName(name string)

func (*ExistsQuery) UnmarshalBSON

func (e *ExistsQuery) UnmarshalBSON(data []byte) error

func (*ExistsQuery) UnmarshalJSON

func (e *ExistsQuery) UnmarshalJSON(data []byte) error

type ExistsQueryParams

type ExistsQueryParams struct {
	Field string
	Name  string
	// contains filtered or unexported fields
}

ExistsQueryParams returns documents that contain an indexed value for a field.

An indexed value may not exist for a document’s field due to a variety of reasons:

- The field in the source JSON is null or []

- The field has "index" : false set in the mapping

- The length of the field value exceeded an ignore_above setting in the mapping

- The field value was malformed and ignore_malformed was defined in the mapping

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html

func (ExistsQueryParams) Clause

func (e ExistsQueryParams) Clause() (QueryClause, error)

func (ExistsQueryParams) Complete

func (ExistsQueryParams) Complete()

func (ExistsQueryParams) Exists

func (e ExistsQueryParams) Exists() (*ExistsQuery, error)

type ExpDecayFunction

type ExpDecayFunction struct {
	// contains filtered or unexported fields
}

func (*ExpDecayFunction) Decay

func (e *ExpDecayFunction) Decay() dynamic.Number

func (*ExpDecayFunction) Field

func (e *ExpDecayFunction) Field() string

func (ExpDecayFunction) Filter

func (e ExpDecayFunction) Filter() QueryClause

func (ExpDecayFunction) FuncKind

func (ExpDecayFunction) FuncKind() FuncKind

func (ExpDecayFunction) MarshalBSON

func (e ExpDecayFunction) MarshalBSON() ([]byte, error)

func (ExpDecayFunction) MarshalJSON

func (e ExpDecayFunction) MarshalJSON() ([]byte, error)

func (*ExpDecayFunction) Offset

func (ExpDecayFunction) Origin

func (e ExpDecayFunction) Origin() interface{}

func (ExpDecayFunction) Scale

func (*ExpDecayFunction) SetDecay

func (e *ExpDecayFunction) SetDecay(value interface{}) error

func (*ExpDecayFunction) SetField

func (e *ExpDecayFunction) SetField(field string) error

func (*ExpDecayFunction) SetFilter

func (e *ExpDecayFunction) SetFilter(c CompleteClauser) error

func (*ExpDecayFunction) SetOffset

func (e *ExpDecayFunction) SetOffset(offset interface{}) error

func (*ExpDecayFunction) SetOrigin

func (e *ExpDecayFunction) SetOrigin(origin interface{}) error

func (*ExpDecayFunction) SetScale

func (e *ExpDecayFunction) SetScale(scale interface{}) error

func (*ExpDecayFunction) SetWeight

func (b *ExpDecayFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*ExpDecayFunction) Weight

func (b *ExpDecayFunction) Weight() float64

type ExpDecayFunctionParams

type ExpDecayFunctionParams struct {
	// Field
	Field string
	// Weight (float)
	Weight interface{}
	// The point of origin used for calculating distance. Must be given as a
	// number for numeric field, date for date fields and geo point for geo
	// fields. Required for geo and numeric field. For date fields the default
	// is now. Date math (for example now-1h) is supported for origin.
	Origin interface{}
	// Required for all types. Defines the distance from origin + offset at
	// which the computed score will equal decay parameter. For geo fields: Can
	// be defined as number+unit (1km, 12m,…​). Default unit is meters. For date
	// fields: Can to be defined as a number+unit ("1h", "10d",…​). Default unit
	// is milliseconds. For numeric field: Any number.
	Scale interface{}
	// 	If an offset is defined, the decay function will only compute the decay
	// 	function for documents with a distance greater than the defined offset.
	// 	The default is 0.
	Offset interface{}
	// The decay parameter defines how documents are scored at the distance
	// given at scale. If no decay is defined, documents at the distance scale
	// will be scored 0.5.
	Decay  interface{}
	Filter CompleteClauser
}

func (ExpDecayFunctionParams) FuncKind

func (ExpDecayFunctionParams) FuncKind() FuncKind

func (ExpDecayFunctionParams) Function

func (e ExpDecayFunctionParams) Function() (Function, error)

type Field

type Field interface {
	Fielder
	json.Marshaler
	json.Unmarshaler
}

Field is an elasticsearch field mapping

type FieldDataFrequencyFilter

type FieldDataFrequencyFilter struct {
	Min            float64 `bson:"min" json:"min"`
	Max            float64 `bson:"max" json:"max"`
	MinSegmentSize int     `bson:"min_segment_size" json:"min_segment_size"`
}

FieldDataFrequencyFilter is utilized with mappings

type FieldError

type FieldError struct {
	Field string
	Err   error
}

func (*FieldError) Error

func (e *FieldError) Error() string

func (*FieldError) Unwrap

func (e *FieldError) Unwrap() error

type FieldMap

type FieldMap map[string]Fielder

func (FieldMap) Field

func (f FieldMap) Field(field string) (Field, error)

func (FieldMap) Fields

func (f FieldMap) Fields() (Fields, error)

func (FieldMap) Has

func (f FieldMap) Has(key string) bool

func (FieldMap) Len

func (f FieldMap) Len() int

func (FieldMap) Remove

func (f FieldMap) Remove(field string) Field

func (FieldMap) Set

func (f FieldMap) Set(name string, params Fielder) (Field, error)

type FieldMappings

type FieldMappings struct {
	Properties Fields `json:"properties"`
}

type FieldMaskingSpanQuery

type FieldMaskingSpanQuery struct {
	// contains filtered or unexported fields
}

func (*FieldMaskingSpanQuery) Clause

func (q *FieldMaskingSpanQuery) Clause() (QueryClause, error)

func (*FieldMaskingSpanQuery) Clear

func (q *FieldMaskingSpanQuery) Clear()

func (FieldMaskingSpanQuery) Complete

func (FieldMaskingSpanQuery) Complete()

func (*FieldMaskingSpanQuery) FieldMaskingSpan

func (q *FieldMaskingSpanQuery) FieldMaskingSpan() (*FieldMaskingSpanQuery, error)

func (*FieldMaskingSpanQuery) IsEmpty

func (q *FieldMaskingSpanQuery) IsEmpty() bool

func (FieldMaskingSpanQuery) Kind

func (FieldMaskingSpanQuery) MarshalBSON

func (q FieldMaskingSpanQuery) MarshalBSON() ([]byte, error)

func (FieldMaskingSpanQuery) MarshalJSON

func (q FieldMaskingSpanQuery) MarshalJSON() ([]byte, error)

func (FieldMaskingSpanQuery) Name

func (n FieldMaskingSpanQuery) Name() string

func (*FieldMaskingSpanQuery) SetName

func (n *FieldMaskingSpanQuery) SetName(name string)

func (*FieldMaskingSpanQuery) UnmarshalBSON

func (q *FieldMaskingSpanQuery) UnmarshalBSON(data []byte) error

func (*FieldMaskingSpanQuery) UnmarshalJSON

func (q *FieldMaskingSpanQuery) UnmarshalJSON(data []byte) error

type FieldMaskingSpanQueryParams

type FieldMaskingSpanQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (FieldMaskingSpanQueryParams) Clause

func (FieldMaskingSpanQueryParams) Complete

func (FieldMaskingSpanQueryParams) Complete()

func (FieldMaskingSpanQueryParams) FieldMaskingSpan

func (p FieldMaskingSpanQueryParams) FieldMaskingSpan() (*FieldMaskingSpanQuery, error)

func (FieldMaskingSpanQueryParams) Kind

type FieldType

type FieldType string

FieldType of ElasticSearch Mapping

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#mapping-types

const (
	// FieldTypeBinary is a value encoded as a Base64 string.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/binary.html
	FieldTypeBinary FieldType = "binary"

	// FieldTypeBoolean is for true and false values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html
	FieldTypeBoolean FieldType = "boolean"

	// FieldTypeKeyword is used for structured content such as
	// IDs, email addresses, hostnames, status codes, zip codes, or tags.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#keyword-field-type
	FieldTypeKeyword FieldType = "keyword"

	// FieldTypeConstant is for keyword fields that always contain the same value.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#constant-keyword-field-type
	FieldTypeConstant FieldType = "constant_keyword"

	// FieldTypeWildcardKeyword optimizes log lines and similar keyword values for grep-like wildcard queries.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#wildcard-field-type
	FieldTypeWildcardKeyword FieldType = "wildcard"

	// FieldTypeLong is a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeLong FieldType = "long"

	// FieldTypeInteger is a signed 32-bit integer with a minimum value of -231 and a maximum value of 231-1.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeInteger FieldType = "integer"

	// FieldTypeShort is a signed 16-bit integer with a minimum value of -32,768 and a maximum value of 32,767.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeShort FieldType = "short"

	// FieldTypeByte is a signed 8-bit integer with a minimum value of -128 and a maximum value of 127.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeByte FieldType = "byte"

	// FieldTypeDouble is a double-precision 64-bit IEEE 754 floating point number, restricted to finite values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeDouble FieldType = "double"

	// FieldTypeFloat is a single-precision 32-bit IEEE 754 floating point number, restricted to finite values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeFloat FieldType = "float"

	// FieldTypeHalfFloat is a half-precision 16-bit IEEE 754 floating point number, restricted to finite values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeHalfFloat FieldType = "half_float"

	// FieldTypeScaledFloat is a floating point number that is backed by a long, scaled by a fixed double scaling factor.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeScaledFloat FieldType = "scaled_float"

	// FieldTypeUnsignedLong is an unsigned 64-bit integer with a minimum value of 0 and a maximum value of 264-1.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	FieldTypeUnsignedLong FieldType = "unsigned_long"

	// FieldTypeDateNanos is an addition to the date data type. However there is an important
	// distinction between the two. The existing date data type stores dates in millisecond
	// resolution. The date_nanos data type stores dates in nanosecond resolution, which
	// limits its range of dates from roughly 1970 to 2262, as dates are still stored as a
	// long representing nanoseconds since the epoch.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/date_nanos.html
	FieldTypeDateNanos FieldType = "date_nanos"

	// FieldTypeDate is a date in one of the following formats:
	//
	// - strings containing formatted dates, e.g. "2015-01-01" or "2015/01/01 12:10:30".
	//
	// - a long number representing milliseconds-since-the-epoch.
	//
	// - an integer representing seconds-since-the-epoch.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html
	FieldTypeDate FieldType = "date"

	// FieldTypeAlias defines an alias for an existing field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/alias.html
	FieldTypeAlias FieldType = "alias"

	// FieldTypeObject is a JSON object.
	//
	// Options:
	//
	// dynamic - Whether or not new properties should be added dynamically to an
	// existing object. Accepts true (default), false and strict.
	//
	// enabled - Whether the JSON value given for the object field should be parsed
	// and indexed (true, default) or completely ignored (false).
	//
	// properties - The fields within the object, which can be of any data type,
	// including object. New properties may be added to an existing object.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/object.html
	FieldTypeObject FieldType = "object"

	// FieldTypeFlattened is an entire JSON object as a single field value.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/flattened.html
	FieldTypeFlattened FieldType = "flattened"

	// FieldTypeNested is a JSON object that preserves the relationship between its subfields.
	//
	// The nested type is a specialised version of the object data type that allows arrays
	// of objects to be indexed in a way that they can be queried independently of each other.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html
	FieldTypeNested FieldType = "nested"

	//FieldTypeJoin defines a parent/child relationship for documents in the same index.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
	FieldTypeJoin FieldType = "join"

	// FieldTypeLongRange is a range of signed 64-bit integers with a minimum value of -263
	// and maximum of 263-1.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeLongRange FieldType = "long_range"

	// FieldTypeIntegerRange is range of signed 32-bit integers with a minimum value of -231
	// and maximum of 231-1.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeIntegerRange FieldType = "integer_range"

	// FieldTypeFloatRange is a range of single-precision 32-bit IEEE 754 floating point values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeFloatRange FieldType = "float_range"

	// FieldTypeDoubleRange is a range of double-precision 64-bit IEEE 754 floating point values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeDoubleRange FieldType = "double_range"

	// FieldTypeDateRange is a range of date values. Date ranges support various date formats
	// through the format mapping parameter. Regardless of the format used, date values
	// are parsed into an unsigned 64-bit integer representing milliseconds since the
	// Unix epoch in UTC. Values containing the now date math expression are not supported.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeDateRange FieldType = "date_range"

	// FieldTypeIPRange is a range of ip values supporting either IPv4 or IPv6 (or mixed) addresses.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/range.html
	FieldTypeIPRange FieldType = "ip_range"

	// FieldTypeIP is IPv4 and IPv6 addresses.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/ip.html
	FieldTypeIP FieldType = "ip"

	// FieldTypeVersion is a software version. Supports Semantic Versioning precedence rules.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/version.html
	FieldTypeVersion FieldType = "version"

	// FieldTypeMurmur3 compute and stores hashes of values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/plugins/7.11/mapper-murmur3.html
	FieldTypeMurmur3 FieldType = "murmur3"

	// FieldTypeAggregateMetricDouble is a pre-aggregated metric values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/aggregate-metric-double.html
	FieldTypeAggregateMetricDouble FieldType = "aggregate_metric_double"

	// FieldTypeHistogram is a pre-aggregated numerical values in the form of a histogram.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/histogram.html
	FieldTypeHistogram FieldType = "histogram"

	// FieldTypeText is analyzed, unstructured text.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html
	FieldTypeText FieldType = "text"

	// FieldTypeAnnotatedText is text containing special markup. Used for identifying named entities.
	//
	// https://www.elastic.co/guide/en/elasticsearch/plugins/7.11/mapper-annotated-text.html
	FieldTypeAnnotatedText FieldType = "annotated-text"

	// FieldTypeCompletion is used for auto-complete suggestions.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester
	FieldTypeCompletion FieldType = "completion"

	// FieldTypeSearchAsYouType is text-like type for as-you-type completion.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/search-as-you-type.html
	FieldTypeSearchAsYouType FieldType = "search_as_you_type"

	// FieldTypeTokenCount is a count of tokens in a text.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/token-count.html
	FieldTypeTokenCount FieldType = "token_count"

	// FieldTypeDenseVector is a Document Ranking Type that records dense vectors of float values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html
	FieldTypeDenseVector FieldType = "dense_vector"

	//float64 FieldTypeRankFeature is a Document Ranking Type that can index numbers so that they can later
	// be used to boost documents in queries with a rank_feature query
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-feature.html
	FieldTypeRankFeature FieldType = "rank_feature"

	// FieldTypeRankFeatures is a Document Ranking Type that can index numeric feature vectors,
	// so that they can later be used to boost documents in queries with a rank_feature query.
	//
	// It is analogous to the rank_feature data type but is better suited when the list of
	// features is sparse so that it wouldn’t be reasonable to add one field to the mappings
	// for each of them.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-features.html
	FieldTypeRankFeatures FieldType = "rank_features"

	// FieldTypeGeoPoint is  a latitude and longitude points.
	//
	// Fields of type geo_point accept latitude-longitude pairs, which can be used:
	//
	// - to find geo-points within a bounding box, within a certain distance of a central point, or within a polygon or within a geo_shape query.
	//
	// - to aggregate documents geographically or by distance from a central point.
	//
	// - to integrate distance into a document’s relevance score.
	//
	// - to sort documents by distance.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html
	FieldTypeGeoPoint FieldType = "geo_point"

	// FieldTypeGeoShape are complex shapes, such as polygons.
	//
	// The geo_shape data type facilitates the indexing of and searching with arbitrary
	// geo shapes such as rectangles and polygons. It should be used when either the
	// data being indexed or the queries being executed contain shapes other than just
	// points.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html
	FieldTypeGeoShape FieldType = "geo_shape"
	// FieldTypePoint is an arbitrary cartesian points.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/point.html
	FieldTypePoint FieldType = "point"

	// FieldTypeShape data type facilitates the indexing of and searching with arbitrary
	// x, y cartesian shapes such as rectangles and polygons. It can be used to
	// index and query geometries whose coordinates fall in a 2-dimensional planar
	// coordinate system.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/shape.html
	FieldTypeShape FieldType = "shape"

	// FieldTypePercolator indexes queries written in Query DSL.
	//
	// The percolator field type parses a json structure into a native query and stores that
	// query, so that the percolate query can use it to match provided documents.
	//
	// Any field that contains a json object can be configured to be a percolator field.
	// The percolator field type has no settings. Just configuring the percolator field type
	// is sufficient to instruct Elasticsearch to treat a field as a query.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/percolator.html
	FieldTypePercolator FieldType = "percolator"
)

type FieldValueFactorFunc

type FieldValueFactorFunc struct {
	// 	Field to be extracted from the document.
	Field string
	// 	Optional factor to multiply the field value with, defaults to 1.
	Factor interface{}
	// Modifier to apply to the field value, can be one of: none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt, or reciprocal. Defaults to none.
	Modifier Modifier
	// Value used if the document doesn’t have that field. The modifier and factor are still applied to it as though it were read from the document.
	Missing interface{}
	// (optional) Query to filter (such as picker.TermQuery, picker.MatchQuery, and so on)
	Filter CompleteClauser
	// Float
	Weight interface{}
}

func (FieldValueFactorFunc) FieldValueFactorFunction

func (fvf FieldValueFactorFunc) FieldValueFactorFunction() (*FieldValueFactorFunction, error)

func (FieldValueFactorFunc) FuncKind

func (FieldValueFactorFunc) FuncKind() FuncKind

func (FieldValueFactorFunc) Function

func (fvf FieldValueFactorFunc) Function() (Function, error)

type FieldValueFactorFunction

type FieldValueFactorFunction struct {
	// contains filtered or unexported fields
}

func (FieldValueFactorFunction) Factor

func (fvf FieldValueFactorFunction) Factor() float64

func (FieldValueFactorFunction) Field

func (fvf FieldValueFactorFunction) Field() string

func (FieldValueFactorFunction) Filter

func (FieldValueFactorFunction) FuncKind

func (FieldValueFactorFunction) MarshalJSON

func (fvf FieldValueFactorFunction) MarshalJSON() ([]byte, error)

func (FieldValueFactorFunction) Missing

func (fvf FieldValueFactorFunction) Missing() interface{}

func (*FieldValueFactorFunction) Modifier

func (m *FieldValueFactorFunction) Modifier() Modifier

func (FieldValueFactorFunction) SetFactor

func (fvf FieldValueFactorFunction) SetFactor(v interface{}) error

func (*FieldValueFactorFunction) SetField

func (fvf *FieldValueFactorFunction) SetField(field string)

func (*FieldValueFactorFunction) SetFilter

func (fvf *FieldValueFactorFunction) SetFilter(filter CompleteClauser) error

func (*FieldValueFactorFunction) SetMissing

func (fvf *FieldValueFactorFunction) SetMissing(missing interface{})

func (*FieldValueFactorFunction) SetModifier

func (m *FieldValueFactorFunction) SetModifier(modifier Modifier) error

func (*FieldValueFactorFunction) SetWeight

func (b *FieldValueFactorFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*FieldValueFactorFunction) Weight

func (b *FieldValueFactorFunction) Weight() float64

type Fielder

type Fielder interface {
	Field() (Field, error)
	Type() FieldType
}

type Fields

type Fields map[string]Field

Fields are a collection of Field mappings

func (Fields) Field

func (f Fields) Field(key string) (Field, error)

func (Fields) FieldMap

func (f Fields) FieldMap() FieldMap

func (Fields) Fields

func (f Fields) Fields() (Fields, error)

func (Fields) Get

func (f Fields) Get(key string) (Field, bool)

func (Fields) Has

func (f Fields) Has(key string) bool

func (Fields) Len

func (f Fields) Len() int

func (Fields) Remove

func (f Fields) Remove(field string) Field

func (Fields) Set

func (f Fields) Set(key string, field Fielder) (Field, error)

func (*Fields) UnmarshalBSON

func (f *Fields) UnmarshalBSON(data []byte) error

func (*Fields) UnmarshalJSON

func (f *Fields) UnmarshalJSON(data []byte) error

type Fieldset

type Fieldset interface {
	Fields() (Fields, error)
	Field(string) (Field, error)
	Has(name string) bool
	Set(name string, params Fielder) (Field, error)
	Remove(name string) Field
	Len() int
}

type FlattenedField

type FlattenedField struct {
	// contains filtered or unexported fields
}

FlattenedField maps an entire object as a single field.

By default, each subfield in an object is mapped and indexed separately. If the names or types of the subfields are not known in advance, then they are mapped dynamically.

The flattened type provides an alternative approach, where the entire object is mapped as a single field. Given an object, the flattened mapping will parse out its leaf values and index them into one field as keywords. The object’s contents can then be searched through simple queries and aggregations.

This data type can be useful for indexing objects with a large or unknown number of unique keys. Only one field mapping is created for the whole JSON object, which can help prevent a mappings explosion from having too many distinct field mappings.

On the other hand, flattened object fields present a trade-off in terms of search functionality. Only basic queries are allowed, with no support for numeric range queries or highlighting. Further information on the limitations can be found in the Supported operations section.

! X-Pack

https://www.elastic.co/guide/en/elasticsearch/reference/current/flattened.html

func NewFlattenedField

func NewFlattenedField(params FlattenedFieldParams) (*FlattenedField, error)

func (FlattenedField) DepthLimit

func (dl FlattenedField) DepthLimit() float64

func (FlattenedField) DocValues

func (dv FlattenedField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (FlattenedField) EagerGlobalOrdinals

func (ego FlattenedField) EagerGlobalOrdinals() bool

To support aggregations and other operations that require looking up field values on a per-document basis, Elasticsearch uses a data structure called doc values. Term-based field types such as keyword store their doc values using an ordinal mapping for a more compact representation. This mapping works by assigning each term an incremental integer or ordinal based on its lexicographic order. The field’s doc values store only the ordinals for each document instead of the original terms, with a separate lookup structure to convert between ordinals and terms.

When used during aggregations, ordinals can greatly improve performance. As an example, the terms aggregation relies only on ordinals to collect documents into buckets at the shard-level, then converts the ordinals back to their original term values when combining results across shards.

Each index segment defines its own ordinal mapping, but aggregations collect data across an entire shard. So to be able to use ordinals for shard-level operations like aggregations, Elasticsearch creates a unified mapping called global ordinals. The global ordinal mapping is built on top of segment ordinals, and works by maintaining a map from global ordinal to the local ordinal for each segment.

Global ordinals are used if a search contains any of the following components:

- Certain bucket aggregations on keyword, ip, and flattened fields. This includes terms aggregations as mentioned above, as well as composite, diversified_sampler, and significant_terms.

- Bucket aggregations on text fields that require fielddata to be enabled.

- Operations on parent and child documents from a join field, including has_child queries and parent aggregations.

https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html

func (*FlattenedField) Field

func (f *FlattenedField) Field() (Field, error)

func (FlattenedField) IgnoreAbove

func (ia FlattenedField) IgnoreAbove() float64

IgnoreAbove signals to not index any string longer than this value. Defaults to 2147483647 so that all values would be accepted. Please however note that default dynamic mapping rules create a sub keyword field that overrides this default by setting ignore_above: 256.

func (FlattenedField) Index

func (i FlattenedField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (FlattenedField) IndexOptions

func (io FlattenedField) IndexOptions() IndexOptions

IndexOptions parameter controls what information is added to the inverted index for search and highlighting purposes.

func (FlattenedField) MarshalBSON

func (f FlattenedField) MarshalBSON() ([]byte, error)

func (FlattenedField) MarshalJSON

func (f FlattenedField) MarshalJSON() ([]byte, error)

func (FlattenedField) NullValue

func (nv FlattenedField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (FlattenedField) SetDepthLimit

func (dl FlattenedField) SetDepthLimit(v interface{}) error

func (*FlattenedField) SetDocValues

func (dv *FlattenedField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*FlattenedField) SetEagerGlobalOrdinals

func (ego *FlattenedField) SetEagerGlobalOrdinals(v interface{}) error

SetEagerGlobalOrdinals sets the eager_global_ordinals value to v

func (FlattenedField) SetIgnoreAbove

func (ia FlattenedField) SetIgnoreAbove(v interface{}) error

SetIgnoreAbove sets the IgnoreAbove value to v

func (*FlattenedField) SetIndex

func (i *FlattenedField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*FlattenedField) SetIndexOptions

func (io *FlattenedField) SetIndexOptions(v IndexOptions) error

SetIndexOptions sets IndexOptions value to v

func (*FlattenedField) SetNullValue

func (nv *FlattenedField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*FlattenedField) SetSimilarity

func (s *FlattenedField) SetSimilarity(v Similarity) error

SetSimilarity sets the Similarity Value to v

func (*FlattenedField) SetSplitQueriesOnWhitespace

func (sq *FlattenedField) SetSplitQueriesOnWhitespace(v interface{}) error

SetSplitQueriesOnWhitespace sets the SplitQueriesOnWhitespace Value to v

func (FlattenedField) Similarity

func (s FlattenedField) Similarity() Similarity

Similarity is mostly useful for text fields, but can also apply to other field types.

func (FlattenedField) SplitQueriesOnWhitespace

func (sq FlattenedField) SplitQueriesOnWhitespace() bool

SplitQueriesOnWhitespace determines whether full text queries should split the input on whitespace when building a query for this field. Accepts true or false (default).

func (FlattenedField) Type

func (FlattenedField) Type() FieldType

func (*FlattenedField) UnmarshalBSON

func (f *FlattenedField) UnmarshalBSON(data []byte) error

func (*FlattenedField) UnmarshalJSON

func (f *FlattenedField) UnmarshalJSON(data []byte) error

type FlattenedFieldParams

type FlattenedFieldParams struct {
	// The maximum allowed depth of the flattened object field, in terms of
	// nested inner objects. If a flattened object field exceeds this limit,
	// then an error will be thrown. Defaults to 20. Note that depth_limit can
	// be updated dynamically through the update mapping API.
	DepthLimit interface{} `json:"depth_limit,omitempty"`
	// Should the field be stored on disk in a column-stride fashion, so that it
	// can later be used for sorting, aggregations, or scripting? Accepts true
	// (default) or false.
	DocValues interface{} `json:"doc_values,omitempty"`
	// Should global ordinals be loaded eagerly on refresh? Accepts true or
	// false (default). Enabling this is a good idea on fields that are
	// frequently used for terms aggregations.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html
	EagerGlobalOrdinals interface{} `json:"eager_global_ordinals,omitempty"`
	// Leaf values longer than this limit will not be indexed. By default, there
	// is no limit and all values will be indexed. Note that this limit applies
	// to the leaf values within the flattened object field, and not the length
	// of the entire field.
	IgnoreAbove interface{} `json:"ignore_above,omitempty"`
	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool or string that can be parsed as a bool)
	Index interface{} `bson:"index,omitempty" json:"index,omitempty"`
	// What information should be stored in the index for scoring purposes.
	// Defaults to docs but can also be set to freqs to take term frequency into
	// account when computing scores.
	IndexOptions IndexOptions `json:"index_options,omitempty"`
	// A string value which is substituted for any explicit null values within
	// the flattened object field. Defaults to null, which means null sields are
	// treated as if it were missing.
	NullValue interface{} `json:"null_value,omitempty"`
	// Which scoring algorithm or similarity should be used. Defaults to BM25.
	Similarity Similarity `json:"similarity,omitempty"`
	// Whether full text queries should split the input on whitespace when
	// building a query for this field. Accepts true or false (default).
	SplitQueriesOnWhitespace interface{} `json:"split_queries_on_whitespace,omitempty"`
}

func (FlattenedFieldParams) Field

func (p FlattenedFieldParams) Field() (Field, error)

func (FlattenedFieldParams) Flattened

func (p FlattenedFieldParams) Flattened() (*FlattenedField, error)

func (FlattenedFieldParams) Type

type FloatField

type FloatField struct {
	// contains filtered or unexported fields
}

A FloatField is a single-precision 32-bit IEEE 754 floating point number, restricted to finite values.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewFloatField

func NewFloatField(params FloatFieldParams) (*FloatField, error)

func (FloatField) Boost

func (b FloatField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (FloatField) Coerce

func (cp FloatField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (FloatField) DocValues

func (dv FloatField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*FloatField) Field

func (f *FloatField) Field() (Field, error)

func (FloatField) IgnoreMalformed

func (im FloatField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (FloatField) Index

func (i FloatField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (FloatField) MarshalBSON

func (f FloatField) MarshalBSON() ([]byte, error)

func (FloatField) MarshalJSON

func (f FloatField) MarshalJSON() ([]byte, error)

func (FloatField) Meta

func (m FloatField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (FloatField) NullValue

func (nv FloatField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*FloatField) SetBoost

func (b *FloatField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*FloatField) SetCoerce

func (cp *FloatField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*FloatField) SetDocValues

func (dv *FloatField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*FloatField) SetIgnoreMalformed

func (im *FloatField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*FloatField) SetIndex

func (i *FloatField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*FloatField) SetMeta

func (m *FloatField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*FloatField) SetNullValue

func (nv *FloatField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*FloatField) SetStore

func (sa *FloatField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (FloatField) Store

func (sa FloatField) Store() bool

Store returns the StoreAttr Value or false

func (FloatField) Type

func (FloatField) Type() FieldType

func (*FloatField) UnmarshalBSON

func (f *FloatField) UnmarshalBSON(data []byte) error

func (*FloatField) UnmarshalJSON

func (f *FloatField) UnmarshalJSON(data []byte) error

type FloatFieldParams

type FloatFieldParams numberFieldParams

func (FloatFieldParams) Field

func (p FloatFieldParams) Field() (Field, error)

func (FloatFieldParams) Float

func (p FloatFieldParams) Float() (*FloatField, error)

func (FloatFieldParams) Type

func (FloatFieldParams) Type() FieldType

type FloatRangeField

type FloatRangeField struct {
	// contains filtered or unexported fields
}

FloatRangeField is a range of single-precision 32-bit IEEE 754 floating point values.

func NewFloatRangeField

func NewFloatRangeField(params FloatRangeFieldParams) (*FloatRangeField, error)

func (FloatRangeField) Coerce

func (cp FloatRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*FloatRangeField) Field

func (r *FloatRangeField) Field() (Field, error)

func (FloatRangeField) Index

func (i FloatRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (FloatRangeField) MarshalBSON

func (r FloatRangeField) MarshalBSON() ([]byte, error)

func (FloatRangeField) MarshalJSON

func (r FloatRangeField) MarshalJSON() ([]byte, error)

func (*FloatRangeField) SetCoerce

func (cp *FloatRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*FloatRangeField) SetIndex

func (i *FloatRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*FloatRangeField) SetStore

func (sa *FloatRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (FloatRangeField) Store

func (sa FloatRangeField) Store() bool

Store returns the StoreAttr Value or false

func (FloatRangeField) Type

func (FloatRangeField) Type() FieldType

func (*FloatRangeField) UnmarshalBSON

func (r *FloatRangeField) UnmarshalBSON(data []byte) error

func (*FloatRangeField) UnmarshalJSON

func (r *FloatRangeField) UnmarshalJSON(data []byte) error

type FloatRangeFieldParams

type FloatRangeFieldParams rangeFieldParams

func (FloatRangeFieldParams) Field

func (p FloatRangeFieldParams) Field() (Field, error)

func (FloatRangeFieldParams) FloatRange

func (p FloatRangeFieldParams) FloatRange() (*FloatRangeField, error)

func (FloatRangeFieldParams) Type

type FuncKind

type FuncKind string
const (
	// ScoreExp is an exponential decay function
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-decay
	FuncKindExp FuncKind = "exp"
	// ScoreGause is normal decay
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-decay
	FuncKindGauss FuncKind = "gauss"
	// FuncKindLinearDecay decay
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-decay
	FuncKindLinear FuncKind = "linear"
	// FuncKindWeight allows you to multiply the score by the provided weight. This
	// can sometimes be desired since boost value set on specific queries gets
	// normalized, while for this score function it does not. The number value
	// is of type float.
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-weight
	FuncKindWeight FuncKind = "weight"
	// FuncKindScriptScore allows you to wrap another query and customize the
	// scoring of it optionally with a computation derived from other numeric
	// field values in the doc using a script expression.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-script-score
	FuncKindScriptScore FuncKind = "script_score"
	// FuncKindRandomScore generates scores that are uniformly distributed from 0 up to
	// but not including 1. By default, it uses the internal Lucene doc ids as a
	// source of randomness, which is very efficient but unfortunately not
	// reproducible since documents might be renumbered by merges.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-random
	FuncKindRandomScore FuncKind = "random_score"
	// FuncKindFieldValueFactor function allows you to use a field from a document
	// to influence the score. It’s similar to using the script_score function,
	// however, it avoids the overhead of scripting. If used on a multi-valued
	// field, only the first value of the field is used in calculations
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-field-value-factor
	FuncKindFieldValueFactor FuncKind = "field_value_factor"
)

func (FuncKind) String

func (f FuncKind) String() string

type Funcs

type Funcs []Functioner

Funcs is a slice of Functioners, valid options are:

  • picker.WeightFunc,
  • picker.LinearFunc,
  • picker.ExpFunc,
  • picker.GaussFunc,
  • picker.RandomScoreFunc,
  • picker.ScriptScoreFunc,
  • picker.FieldValueFactorFunc

type Function

type Function interface {
	FuncKind() FuncKind
	Weight() float64
	SetWeight(interface{}) error
	Filter() QueryClause
	SetFilter(CompleteClauser) error
	json.Marshaler
}

type FunctionScoreQuery

type FunctionScoreQuery struct {
	// contains filtered or unexported fields
}

FunctionScoreQuery allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score function is computationally expensive and it is sufficient to compute the score on a filtered set of documents.

To use function_score, the user has to define a query and one or more functions, that compute a new score for each document returned by the query.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html

func (FunctionScoreQuery) Boost

func (b FunctionScoreQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*FunctionScoreQuery) BoostMode

func (bm *FunctionScoreQuery) BoostMode() BoostMode

func (*FunctionScoreQuery) Clause

func (fs *FunctionScoreQuery) Clause() (QueryClause, error)

func (*FunctionScoreQuery) Clear

func (fs *FunctionScoreQuery) Clear()

func (FunctionScoreQuery) Complete

func (FunctionScoreQuery) Complete()

func (*FunctionScoreQuery) Functions

func (fs *FunctionScoreQuery) Functions() Functions

func (*FunctionScoreQuery) IsEmpty

func (fs *FunctionScoreQuery) IsEmpty() bool

func (FunctionScoreQuery) Kind

func (FunctionScoreQuery) MarshalJSON

func (fs FunctionScoreQuery) MarshalJSON() ([]byte, error)

func (FunctionScoreQuery) MaxBoost

func (mb FunctionScoreQuery) MaxBoost() float64

func (FunctionScoreQuery) MinScore

func (ms FunctionScoreQuery) MinScore() float64

func (*FunctionScoreQuery) Name

func (fs *FunctionScoreQuery) Name() string

func (*FunctionScoreQuery) Query

func (fs *FunctionScoreQuery) Query() *Query

func (*FunctionScoreQuery) ScoreMode

func (sm *FunctionScoreQuery) ScoreMode() ScoreMode

func (*FunctionScoreQuery) SetBoost

func (b *FunctionScoreQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*FunctionScoreQuery) SetBoostMode

func (bm *FunctionScoreQuery) SetBoostMode(boostMode BoostMode) error

func (*FunctionScoreQuery) SetFunctions

func (fs *FunctionScoreQuery) SetFunctions(funcs Funcs) error

func (FunctionScoreQuery) SetMaxBoost

func (mb FunctionScoreQuery) SetMaxBoost(v float64)

func (*FunctionScoreQuery) SetMinScore

func (ms *FunctionScoreQuery) SetMinScore(v float64)

func (*FunctionScoreQuery) SetName

func (n *FunctionScoreQuery) SetName(name string)

func (*FunctionScoreQuery) SetQuery

func (fs *FunctionScoreQuery) SetQuery(query *QueryParams) error

func (*FunctionScoreQuery) SetScoreMode

func (sm *FunctionScoreQuery) SetScoreMode(scoreMode ScoreMode) error

func (*FunctionScoreQuery) UnmarshalJSON

func (fs *FunctionScoreQuery) UnmarshalJSON(data []byte) error

type FunctionScoreQueryParams

type FunctionScoreQueryParams struct {
	Query *QueryParams
	Boost interface{}
	// Documents with a score lower than this floating point number are excluded
	// from the search results. (Optional)
	MinScore  float64
	MaxBoost  float64
	BoostMode BoostMode
	ScoreMode ScoreMode
	Functions Funcs
	Name      string
}

FunctionScoreQueryParams allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score function is computationally expensive and it is sufficient to compute the score on a filtered set of documents.

To use function_score, the user has to define a query and one or more functions, that compute a new score for each document returned by the query.

func (*FunctionScoreQueryParams) Clause

func (fs *FunctionScoreQueryParams) Clause() (QueryClause, error)

func (*FunctionScoreQueryParams) FunctionScore

func (fs *FunctionScoreQueryParams) FunctionScore() (*FunctionScoreQuery, error)

type FunctionScorer

type FunctionScorer interface {
	FunctionScore() (*FunctionScoreQuery, error)
}

type Functioner

type Functioner interface {
	Function() (Function, error)
}

type Functions

type Functions []Function

func (*Functions) UnmarshalBSON

func (f *Functions) UnmarshalBSON(data []byte) error

func (*Functions) UnmarshalJSON

func (f *Functions) UnmarshalJSON(data []byte) error

type Fuzzier

type Fuzzier interface {
	Fuzzy() (*FuzzyQuery, error)
}

type FuzzyQuery

type FuzzyQuery struct {
	// contains filtered or unexported fields
}

FuzzyQuery returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.

An edit distance is the number of one-character changes needed to turn one term into another. These changes can include:

- Changing a character (box → fox)

- Removing a character (black → lack)

- Inserting a character (sic → sick)

- Transposing two adjacent characters (act → cat)

To find similar terms, the fuzzy query creates a set of all possible variations, or expansions, of the search term within a specified edit distance. The query then returns exact matches for each expansion.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html

func (*FuzzyQuery) Clause

func (f *FuzzyQuery) Clause() (QueryClause, error)

func (*FuzzyQuery) Clear

func (f *FuzzyQuery) Clear()

func (FuzzyQuery) Complete

func (FuzzyQuery) Complete()

func (FuzzyQuery) DefaultFuzzyRewrite

func (f FuzzyQuery) DefaultFuzzyRewrite() Rewrite

func (FuzzyQuery) Field

func (f FuzzyQuery) Field() string

func (FuzzyQuery) Fuzziness

func (f FuzzyQuery) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (FuzzyQuery) FuzzyRewrite

func (f FuzzyQuery) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (*FuzzyQuery) IsEmpty

func (f *FuzzyQuery) IsEmpty() bool

func (FuzzyQuery) Kind

func (f FuzzyQuery) Kind() QueryKind

func (FuzzyQuery) MarshalBSON

func (f FuzzyQuery) MarshalBSON() ([]byte, error)

func (FuzzyQuery) MarshalJSON

func (f FuzzyQuery) MarshalJSON() ([]byte, error)

func (FuzzyQuery) MaxExpansions

func (me FuzzyQuery) MaxExpansions() int

MaxExpansions is the maximum number of variations created. Defaults to 50.

func (FuzzyQuery) Name

func (n FuzzyQuery) Name() string

func (FuzzyQuery) PrefixLength

func (pl FuzzyQuery) PrefixLength() int

func (FuzzyQuery) Rewrite

func (r FuzzyQuery) Rewrite() Rewrite

func (*FuzzyQuery) Set

func (f *FuzzyQuery) Set(field string, fuzzier Fuzzier) error

func (*FuzzyQuery) SetFuzziness

func (f *FuzzyQuery) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*FuzzyQuery) SetFuzzyRewrite

func (f *FuzzyQuery) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*FuzzyQuery) SetMaxExpansions

func (me *FuzzyQuery) SetMaxExpansions(v interface{}) error

func (*FuzzyQuery) SetName

func (n *FuzzyQuery) SetName(name string)

func (*FuzzyQuery) SetPrefixLength

func (pl *FuzzyQuery) SetPrefixLength(v interface{}) error

func (*FuzzyQuery) SetRewrite

func (r *FuzzyQuery) SetRewrite(v Rewrite) error

func (*FuzzyQuery) SetTranspositions

func (t *FuzzyQuery) SetTranspositions(v interface{}) error

SetTranspositions sets the value of Transpositions to v

func (FuzzyQuery) Transpositions

func (t FuzzyQuery) Transpositions() bool

Transpositions indicates whether edits include transpositions of two adjacent characters (ab → ba). Defaults to true.

func (*FuzzyQuery) UnmarshalBSON

func (f *FuzzyQuery) UnmarshalBSON(data []byte) error

func (*FuzzyQuery) UnmarshalJSON

func (f *FuzzyQuery) UnmarshalJSON(data []byte) error

func (*FuzzyQuery) Vale

func (f *FuzzyQuery) Vale() string

type FuzzyQueryParams

type FuzzyQueryParams struct {
	// Value or term to find in the provided <field>. (Required)
	Value string
	// Field which is being queried against.
	//
	// This will be ignored if set through a mutator
	Field string
	// Maximum edit distance allowed for matching. See Fuzziness for valid
	// values and more information. (Optional)
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness
	Fuzziness string
	// PrefixLength is the number of beginning characters left unchanged when
	// creating expansions. Defaults to 0. (Optional)
	PrefixLength int
	// Transpositions indicates whether edits include transpositions of two
	// adjacent characters (ab → ba). (Optional)
	//
	Transpositions interface{}
	// Rewrite method used to rewrite the query. (Optional)
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-term-rewrite.html
	Rewrite Rewrite
	// Maximum number of variations created. Defaults to 50. (Optional)
	//
	// Avoid using a high value in the max_expansions parameter, especially if
	// the prefix_length parameter value is 0. High values in the max_expansions
	// parameter can cause poor performance due to the high number of variations
	// examined.
	MaxExpansions interface{}
	// Name of the query (Optional)
	Name string
}

FuzzyQueryParams returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.

An edit distance is the number of one-character changes needed to turn one term into another. These changes can include:

- Changing a character (box → fox)

- Removing a character (black → lack)

- Inserting a character (sic → sick)

- Transposing two adjacent characters (act → cat)

To find similar terms, the fuzzy query creates a set of all possible variations, or expansions, of the search term within a specified edit distance. The query then returns exact matches for each expansion.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html

func (FuzzyQueryParams) Clause

func (f FuzzyQueryParams) Clause() (QueryClause, error)

func (FuzzyQueryParams) Fuzzy

func (f FuzzyQueryParams) Fuzzy() (*FuzzyQuery, error)

type FuzzyRule

type FuzzyRule struct {
	// contains filtered or unexported fields
}

func (FuzzyRule) Analyzer

func (ap FuzzyRule) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (FuzzyRule) DefaultFuzzyRewrite

func (f FuzzyRule) DefaultFuzzyRewrite() Rewrite

func (FuzzyRule) Filter

func (r FuzzyRule) Filter() *RuleFilter

func (FuzzyRule) Fuzziness

func (f FuzzyRule) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (FuzzyRule) FuzzyRewrite

func (f FuzzyRule) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (FuzzyRule) MarshalBSON

func (f FuzzyRule) MarshalBSON() ([]byte, error)

func (FuzzyRule) MarshalJSON

func (f FuzzyRule) MarshalJSON() ([]byte, error)

func (FuzzyRule) PrefixLength

func (pl FuzzyRule) PrefixLength() int

func (*FuzzyRule) Rule

func (f *FuzzyRule) Rule() (QueryRule, error)

func (*FuzzyRule) SetAnalyzer

func (ap *FuzzyRule) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*FuzzyRule) SetFilter

func (r *FuzzyRule) SetFilter(filter RuleFilterer) error

func (*FuzzyRule) SetFuzziness

func (f *FuzzyRule) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*FuzzyRule) SetFuzzyRewrite

func (f *FuzzyRule) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*FuzzyRule) SetPrefixLength

func (pl *FuzzyRule) SetPrefixLength(v interface{}) error

func (*FuzzyRule) SetTerm

func (f *FuzzyRule) SetTerm(term string) error

func (*FuzzyRule) SetTranspositions

func (t *FuzzyRule) SetTranspositions(v interface{}) error

SetTranspositions sets the value of Transpositions to v

func (*FuzzyRule) SetUseField

func (uf *FuzzyRule) SetUseField(field string)

func (FuzzyRule) Term

func (f FuzzyRule) Term() string

func (FuzzyRule) Transpositions

func (t FuzzyRule) Transpositions() bool

Transpositions indicates whether edits include transpositions of two adjacent characters (ab → ba). Defaults to true.

func (FuzzyRule) Type

func (FuzzyRule) Type() RuleType

func (*FuzzyRule) UnmarshalBSON

func (f *FuzzyRule) UnmarshalBSON(data []byte) error

func (*FuzzyRule) UnmarshalJSON

func (f *FuzzyRule) UnmarshalJSON(data []byte) error

func (FuzzyRule) UseField

func (uf FuzzyRule) UseField() string

type FuzzyRuleParams

type FuzzyRuleParams struct {
	// (Required) The term to match
	Term string `json:"term"`
	// (Optional, string) analyzer used to analyze terms in the query. Defaults
	// to the top-level <field>'s analyzer.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional) An optional interval filter.
	Filter RuleFilterer `json:"filter,omitempty"`
	// (Optional) If specified, then match intervals from this field
	// rather than the top-level <field>.
	//
	// The fuzzy is normalized using the search analyzer from this field,
	// unless a separate analyzer is specified.
	UseField string `json:"use_field,omitempty"`
	// (Optional, integer) Number of beginning characters left unchanged when creating expansions. Defaults to 0.
	PrefixLength int `json:"prefix_length,omitempty"`
	// (Optional, string) Maximum edit distance allowed for matching. See
	// Fuzziness for valid values and more information. Defaults to auto.
	Fuzziness string `json:"fuzziness,omitempty"`
	// (Optional, Boolean) Indicates whether edits include transpositions of two
	// adjacent characters (ab → ba). Defaults to true.
	Transpositions interface{} `json:"transpositions,omitempty"`
}

func (FuzzyRuleParams) FuzzyRule

func (p FuzzyRuleParams) FuzzyRule() (*FuzzyRule, error)

func (FuzzyRuleParams) Rule

func (p FuzzyRuleParams) Rule() (Rule, error)

func (FuzzyRuleParams) Type

func (FuzzyRuleParams) Type() RuleType

type FuzzyRuler

type FuzzyRuler interface {
	FuzzyRule() (*FuzzyRule, error)
}

type GaussFunction

type GaussFunction struct {
	// contains filtered or unexported fields
}

func (*GaussFunction) Decay

func (g *GaussFunction) Decay() dynamic.Number

func (*GaussFunction) Field

func (g *GaussFunction) Field() string

func (GaussFunction) Filter

func (g GaussFunction) Filter() QueryClause

func (GaussFunction) FuncKind

func (GaussFunction) FuncKind() FuncKind

func (GaussFunction) MarshalBSON

func (g GaussFunction) MarshalBSON() ([]byte, error)

func (GaussFunction) MarshalJSON

func (g GaussFunction) MarshalJSON() ([]byte, error)

func (*GaussFunction) Offset

func (GaussFunction) Origin

func (g GaussFunction) Origin() interface{}

func (GaussFunction) Scale

func (*GaussFunction) SetDecay

func (g *GaussFunction) SetDecay(value interface{}) error

func (*GaussFunction) SetField

func (g *GaussFunction) SetField(field string) error

func (*GaussFunction) SetFilter

func (g *GaussFunction) SetFilter(c CompleteClauser) error

func (*GaussFunction) SetOffset

func (g *GaussFunction) SetOffset(offset interface{}) error

func (*GaussFunction) SetOrigin

func (g *GaussFunction) SetOrigin(origin interface{}) error

func (*GaussFunction) SetScale

func (g *GaussFunction) SetScale(scale interface{}) error

func (*GaussFunction) SetWeight

func (b *GaussFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*GaussFunction) Weight

func (b *GaussFunction) Weight() float64

type GaussFunctionParams

type GaussFunctionParams struct {
	// Field
	Field string
	// Weight (float)
	Weight interface{}
	// The point of origin used for calculating distance. Must be given as a
	// number for numeric field, date for date fields and geo point for geo
	// fields. Required for geo and numeric field. For date fields the default
	// is now. Date math (for example now-1h) is supported for origin.
	Origin interface{}
	// Required for all types. Defines the distance from origin + offset at
	// which the computed score will equal decay parameter. For geo fields: Can
	// be defined as number+unit (1km, 12m,…​). Default unit is meters. For date
	// fields: Can to be defined as a number+unit ("1h", "10d",…​). Default unit
	// is milliseconds. For numeric field: Any number.
	Scale interface{}
	// 	If an offset is defined, the decay function will only compute the decay
	// 	function for documents with a distance greater than the defined offset.
	// 	The default is 0.
	Offset interface{}
	// The decay parameter defines how documents are scored at the distance
	// given at scale. If no decay is defined, documents at the distance scale
	// will be scored 0.5.
	Decay  interface{}
	Filter CompleteClauser
}

func (GaussFunctionParams) FuncKind

func (GaussFunctionParams) FuncKind() FuncKind

func (GaussFunctionParams) Function

func (g GaussFunctionParams) Function() (Function, error)

type GeoBoundingBoxQuery

type GeoBoundingBoxQuery struct {
	// contains filtered or unexported fields
}

func (GeoBoundingBoxQuery) BoundingBox

func (g GeoBoundingBoxQuery) BoundingBox() interface{}

func (*GeoBoundingBoxQuery) Clause

func (g *GeoBoundingBoxQuery) Clause() (QueryClause, error)

func (*GeoBoundingBoxQuery) Clear

func (g *GeoBoundingBoxQuery) Clear()

func (GeoBoundingBoxQuery) Complete

func (GeoBoundingBoxQuery) Complete()

func (GeoBoundingBoxQuery) DecodeBoundingBox

func (g GeoBoundingBoxQuery) DecodeBoundingBox(v interface{}) error

func (GeoBoundingBoxQuery) Field

func (f GeoBoundingBoxQuery) Field() string

func (*GeoBoundingBoxQuery) GeoBoundingBox

func (g *GeoBoundingBoxQuery) GeoBoundingBox() (*GeoBoundingBoxQuery, error)

func (*GeoBoundingBoxQuery) IsEmpty

func (g *GeoBoundingBoxQuery) IsEmpty() bool

func (GeoBoundingBoxQuery) Kind

func (GeoBoundingBoxQuery) MarshalBSON

func (g GeoBoundingBoxQuery) MarshalBSON() ([]byte, error)

func (GeoBoundingBoxQuery) MarshalJSON

func (g GeoBoundingBoxQuery) MarshalJSON() ([]byte, error)

func (GeoBoundingBoxQuery) Name

func (n GeoBoundingBoxQuery) Name() string

func (*GeoBoundingBoxQuery) SetBoundingBox

func (g *GeoBoundingBoxQuery) SetBoundingBox(bb BoundingBoxer)

func (*GeoBoundingBoxQuery) SetField

func (f *GeoBoundingBoxQuery) SetField(field string) error

func (*GeoBoundingBoxQuery) SetName

func (n *GeoBoundingBoxQuery) SetName(name string)

func (*GeoBoundingBoxQuery) SetType

func (g *GeoBoundingBoxQuery) SetType(typ string)

func (GeoBoundingBoxQuery) Type

func (g GeoBoundingBoxQuery) Type() string

func (*GeoBoundingBoxQuery) UnmarshalBSON

func (g *GeoBoundingBoxQuery) UnmarshalBSON(data []byte) error

func (*GeoBoundingBoxQuery) UnmarshalJSON

func (g *GeoBoundingBoxQuery) UnmarshalJSON(data []byte) error

type GeoBoundingBoxQueryParams

type GeoBoundingBoxQueryParams struct {
	Type        string        `json:"type,omitempty"`
	BoundingBox BoundingBoxer `json:"bounding_box"`
	Field       string        `json:"field"`
	Name        string        `json:"_name,omitempty"`
	// contains filtered or unexported fields
}

func (GeoBoundingBoxQueryParams) Clause

func (GeoBoundingBoxQueryParams) Complete

func (GeoBoundingBoxQueryParams) Complete()

func (GeoBoundingBoxQueryParams) GeoBoundingBox

func (p GeoBoundingBoxQueryParams) GeoBoundingBox() (*GeoBoundingBoxQuery, error)

func (GeoBoundingBoxQueryParams) Kind

type GeoBoundingBoxer

type GeoBoundingBoxer interface {
	GeoBoundingBox() (*GeoBoundingBoxQuery, error)
}

type GeoDistanceQuery

type GeoDistanceQuery struct {
	// contains filtered or unexported fields
}

func (*GeoDistanceQuery) Clause

func (q *GeoDistanceQuery) Clause() (QueryClause, error)

func (*GeoDistanceQuery) Clear

func (q *GeoDistanceQuery) Clear()

func (GeoDistanceQuery) Complete

func (GeoDistanceQuery) Complete()

func (GeoDistanceQuery) DecodeGeoPoint

func (q GeoDistanceQuery) DecodeGeoPoint(v interface{}) error

func (GeoDistanceQuery) Distance

func (q GeoDistanceQuery) Distance() string

func (GeoDistanceQuery) DistanceType

func (q GeoDistanceQuery) DistanceType() DistanceType

func (GeoDistanceQuery) Field

func (f GeoDistanceQuery) Field() string

func (*GeoDistanceQuery) GeoDistance

func (q *GeoDistanceQuery) GeoDistance() (*GeoDistanceQuery, error)

func (GeoDistanceQuery) GeoPoint

func (q GeoDistanceQuery) GeoPoint() interface{}

func (*GeoDistanceQuery) IsEmpty

func (q *GeoDistanceQuery) IsEmpty() bool

func (GeoDistanceQuery) Kind

func (GeoDistanceQuery) Kind() QueryKind

func (GeoDistanceQuery) MarshalBSON

func (q GeoDistanceQuery) MarshalBSON() ([]byte, error)

func (GeoDistanceQuery) MarshalJSON

func (q GeoDistanceQuery) MarshalJSON() ([]byte, error)

func (GeoDistanceQuery) Name

func (n GeoDistanceQuery) Name() string

func (*GeoDistanceQuery) SetDistance

func (q *GeoDistanceQuery) SetDistance(distance string) error

func (*GeoDistanceQuery) SetDistanceType

func (q *GeoDistanceQuery) SetDistanceType(typ DistanceType) error

func (*GeoDistanceQuery) SetField

func (f *GeoDistanceQuery) SetField(field string) error

func (*GeoDistanceQuery) SetGeoPoint

func (q *GeoDistanceQuery) SetGeoPoint(v interface{}) error

func (*GeoDistanceQuery) SetName

func (n *GeoDistanceQuery) SetName(name string)

func (*GeoDistanceQuery) SetValidationMethod

func (q *GeoDistanceQuery) SetValidationMethod(method ValidationMethod) error

func (*GeoDistanceQuery) UnmarshalBSON

func (q *GeoDistanceQuery) UnmarshalBSON(data []byte) error

func (*GeoDistanceQuery) UnmarshalJSON

func (q *GeoDistanceQuery) UnmarshalJSON(data []byte) error

func (GeoDistanceQuery) ValidationMethod

func (q GeoDistanceQuery) ValidationMethod() ValidationMethod

type GeoDistanceQueryParams

type GeoDistanceQueryParams struct {
	Distance         string
	Field            string
	DistanceType     DistanceType
	Name             string
	ValidationMethod ValidationMethod
	GeoPoint         interface{}
	// contains filtered or unexported fields
}

func (GeoDistanceQueryParams) Clause

func (GeoDistanceQueryParams) Complete

func (GeoDistanceQueryParams) Complete()

func (GeoDistanceQueryParams) GeoDistance

func (p GeoDistanceQueryParams) GeoDistance() (*GeoDistanceQuery, error)

func (GeoDistanceQueryParams) Kind

type GeoDistancer

type GeoDistancer interface {
	GeoDistance() (*GeoDistanceQuery, error)
}

type GeoPointField

type GeoPointField struct {
	// contains filtered or unexported fields
}

A GeoPointField accepts latitude-longitude pairs, which can be used:

- to find geo-points within a bounding box, within a certain distance of a central point, or within a polygon or within a geo_shape query.

- to aggregate documents geographically or by distance from a central point.

- to integrate distance into a document’s relevance score.

- to sort documents by distance.

Geo-points expressed as an array or string

Please note that string geo-points are ordered as lat,lon, while array geo-points are ordered as the reverse: lon,lat.

Originally, lat,lon was used for both array and string, but the array format was changed early on to conform to the format used by GeoJSON.

A point can be expressed as a geohash. Geohashes are base32 encoded strings of the bits of the latitude and longitude interleaved. Each character in a geohash adds additional 5 bits to the precision. So the longer the hash, the more precise it is. For the indexing purposed geohashs are translated into latitude-longitude pairs. During this process only first 12 characters are used, so specifying more than 12 characters in a geohash doesn’t increase the precision. The 12 characters provide 60 bits, which should reduce a possible error to less than 2cm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html

func NewGeoPointField

func NewGeoPointField(params GeoPointFieldParams) (*GeoPointField, error)

func (*GeoPointField) Field

func (gp *GeoPointField) Field() (Field, error)

func (GeoPointField) IgnoreMalformed

func (im GeoPointField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (GeoPointField) IgnoreZValue

func (z GeoPointField) IgnoreZValue() bool

IgnoreZValue determines whether three dimension points will be indexed.

If true (default) three dimension points will be accepted (stored in source) but only latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points containing any more than latitude and longitude (two dimensions) values throw an exception and reject the whole document.

func (GeoPointField) MarshalJSON

func (gp GeoPointField) MarshalJSON() ([]byte, error)

func (GeoPointField) NullValue

func (nv GeoPointField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*GeoPointField) SetIgnoreMalformed

func (im *GeoPointField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*GeoPointField) SetIgnoreZValue

func (z *GeoPointField) SetIgnoreZValue(v interface{}) error

SetIgnoreZValue sets the IgnoreZValue Value to v

func (*GeoPointField) SetNullValue

func (nv *GeoPointField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (GeoPointField) Type

func (GeoPointField) Type() FieldType

func (*GeoPointField) UnmarshalJSON

func (gp *GeoPointField) UnmarshalJSON(data []byte) error

type GeoPointFieldParams

type GeoPointFieldParams struct {

	// If true, malformed geo-points are ignored. If false (default), malformed
	// geo-points throw an exception and reject the whole document. A geo-point
	// is considered malformed if its latitude is outside the range -90 ⇐
	// latitude ⇐ 90, or if its longitude is outside the range -180 ⇐ longitude
	// ⇐ 180.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// If true (default) three dimension points will be accepted (stored in source)
	// but only latitude and longitude values will be indexed; the third dimension
	// is ignored. If false, geo-points containing any more than latitude and
	// longitude (two dimensions) values throw an exception and reject the whole
	// document.
	IgnoreZValue interface{} `json:"ignore_z_value,omitempty"`
	// Accepts an geopoint value which is substituted for any explicit null values.
	// Defaults to null, which means the field is treated as missing.
	NullValue interface{} `json:"null_value,omitempty"`
}

func (GeoPointFieldParams) Field

func (p GeoPointFieldParams) Field() (Field, error)

func (GeoPointFieldParams) GeoPoint

func (p GeoPointFieldParams) GeoPoint() (*GeoPointField, error)

func (GeoPointFieldParams) Type

type GeoPolygonQuery

type GeoPolygonQuery struct {
	// contains filtered or unexported fields
}

func (*GeoPolygonQuery) Clause

func (q *GeoPolygonQuery) Clause() (QueryClause, error)

func (*GeoPolygonQuery) Clear

func (q *GeoPolygonQuery) Clear()

func (GeoPolygonQuery) Complete

func (GeoPolygonQuery) Complete()

func (*GeoPolygonQuery) GeoPolygon

func (q *GeoPolygonQuery) GeoPolygon() (*GeoPolygonQuery, error)

func (*GeoPolygonQuery) IsEmpty

func (q *GeoPolygonQuery) IsEmpty() bool

func (GeoPolygonQuery) Kind

func (GeoPolygonQuery) Kind() QueryKind

func (GeoPolygonQuery) MarshalBSON

func (q GeoPolygonQuery) MarshalBSON() ([]byte, error)

func (GeoPolygonQuery) MarshalJSON

func (q GeoPolygonQuery) MarshalJSON() ([]byte, error)

func (GeoPolygonQuery) Name

func (n GeoPolygonQuery) Name() string

func (*GeoPolygonQuery) SetName

func (n *GeoPolygonQuery) SetName(name string)

func (*GeoPolygonQuery) UnmarshalBSON

func (q *GeoPolygonQuery) UnmarshalBSON(data []byte) error

func (*GeoPolygonQuery) UnmarshalJSON

func (q *GeoPolygonQuery) UnmarshalJSON(data []byte) error

type GeoPolygonQueryParams

type GeoPolygonQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (GeoPolygonQueryParams) Clause

func (p GeoPolygonQueryParams) Clause() (QueryClause, error)

func (GeoPolygonQueryParams) Complete

func (GeoPolygonQueryParams) Complete()

func (GeoPolygonQueryParams) GeoPolygon

func (p GeoPolygonQueryParams) GeoPolygon() (*GeoPolygonQuery, error)

func (GeoPolygonQueryParams) Kind

type GeoShapeField

type GeoShapeField struct {
	// contains filtered or unexported fields
}

GeoShapeField facilitates the indexing of and searching with arbitrary geo shapes such as rectangles and polygons. It should be used when either the data being indexed or the queries being executed contain shapes other than just points.

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html

func NewGeoShapeField

func NewGeoShapeField(params GeoShapeFieldParams) (*GeoShapeField, error)

func (*GeoShapeField) Field

func (gs *GeoShapeField) Field() (Field, error)

func (GeoShapeField) IgnoreMalformed

func (im GeoShapeField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (GeoShapeField) IgnoreZValue

func (z GeoShapeField) IgnoreZValue() bool

IgnoreZValue determines whether three dimension points will be indexed.

If true (default) three dimension points will be accepted (stored in source) but only latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points containing any more than latitude and longitude (two dimensions) values throw an exception and reject the whole document.

func (GeoShapeField) MarshalJSON

func (gs GeoShapeField) MarshalJSON() ([]byte, error)

func (GeoShapeField) NullValue

func (nv GeoShapeField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (GeoShapeField) Orientation

func (o GeoShapeField) Orientation() Orientation

Orientation is the vertex order for the shape’s coordinates list.

Defaults to OrientationRight (RIGHT) to comply with OGC standards. OGC standards define outer ring vertices in counterclockwise order with inner ring (hole) vertices in clockwise order.

func (*GeoShapeField) SetIgnoreMalformed

func (im *GeoShapeField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*GeoShapeField) SetIgnoreZValue

func (z *GeoShapeField) SetIgnoreZValue(v interface{}) error

SetIgnoreZValue sets the IgnoreZValue Value to v

func (*GeoShapeField) SetNullValue

func (nv *GeoShapeField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*GeoShapeField) SetOrientation

func (o *GeoShapeField) SetOrientation(orientation Orientation) error

SetOrientation sets the Orientation Value to v

func (GeoShapeField) Type

func (GeoShapeField) Type() FieldType

func (*GeoShapeField) UnmarshalJSON

func (gs *GeoShapeField) UnmarshalJSON(data []byte) error

type GeoShapeFieldParams

type GeoShapeFieldParams struct {
	// Optional. Vertex order for the shape’s coordinates list.
	//
	//œ This parameter sets and returns only a RIGHT (counterclockwise) or LEFT
	// (clockwise) value. However, you can specify either value in multiple
	// ways.
	// Defaults to RIGHT to comply with OGC standards. OGC standards define outer ring vertices in counterclockwise order with inner ring (hole) vertices in clockwise order.
	//
	// Individual GeoJSON or WKT documents can override this parameter.
	Orientation Orientation `json:"orientation,omitempty"`

	// If true, malformed geo-points are ignored. If false (default), malformed
	// geo-points throw an exception and reject the whole document. A geo-point
	// is considered malformed if its latitude is outside the range -90 ⇐
	// latitude ⇐ 90, or if its longitude is outside the range -180 ⇐ longitude
	// ⇐ 180.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// If true (default) three dimension points will be accepted (stored in source)
	// but only latitude and longitude values will be indexed; the third dimension
	// is ignored. If false, geo-points containing any more than latitude and
	// longitude (two dimensions) values throw an exception and reject the whole
	// document.
	IgnoreZValue interface{} `json:"ignore_z_value,omitempty"`
}

func (GeoShapeFieldParams) Field

func (p GeoShapeFieldParams) Field() (Field, error)

func (GeoShapeFieldParams) GeoShape

func (p GeoShapeFieldParams) GeoShape() (*GeoShapeField, error)

func (GeoShapeFieldParams) Type

type GeoShapeQuery

type GeoShapeQuery struct {
	// contains filtered or unexported fields
}

func (*GeoShapeQuery) Clause

func (q *GeoShapeQuery) Clause() (QueryClause, error)

func (*GeoShapeQuery) Clear

func (q *GeoShapeQuery) Clear()

func (GeoShapeQuery) Complete

func (GeoShapeQuery) Complete()

func (GeoShapeQuery) Field

func (f GeoShapeQuery) Field() string

func (*GeoShapeQuery) GeoShape

func (q *GeoShapeQuery) GeoShape() (*GeoShapeQuery, error)

func (GeoShapeQuery) IgnoreUnmapped

func (q GeoShapeQuery) IgnoreUnmapped() bool

func (*GeoShapeQuery) IsEmpty

func (q *GeoShapeQuery) IsEmpty() bool

func (GeoShapeQuery) Kind

func (GeoShapeQuery) Kind() QueryKind

func (GeoShapeQuery) MarshalBSON

func (q GeoShapeQuery) MarshalBSON() ([]byte, error)

func (GeoShapeQuery) MarshalJSON

func (q GeoShapeQuery) MarshalJSON() ([]byte, error)

func (GeoShapeQuery) Name

func (n GeoShapeQuery) Name() string

func (GeoShapeQuery) Relation

func (q GeoShapeQuery) Relation() SpatialRelation

func (*GeoShapeQuery) SetField

func (f *GeoShapeQuery) SetField(field string) error

func (*GeoShapeQuery) SetIgnoreUnmapped

func (q *GeoShapeQuery) SetIgnoreUnmapped(v bool)

func (*GeoShapeQuery) SetIndexedShape

func (q *GeoShapeQuery) SetIndexedShape(indexed *IndexedShape) error

func (*GeoShapeQuery) SetName

func (n *GeoShapeQuery) SetName(name string)

func (*GeoShapeQuery) SetRelation

func (q *GeoShapeQuery) SetRelation(v SpatialRelation) error

func (*GeoShapeQuery) SetShape

func (q *GeoShapeQuery) SetShape(shape interface{}) error

func (GeoShapeQuery) Shape

func (q GeoShapeQuery) Shape() interface{}

func (*GeoShapeQuery) UnmarshalBSON

func (q *GeoShapeQuery) UnmarshalBSON(data []byte) error

func (*GeoShapeQuery) UnmarshalJSON

func (q *GeoShapeQuery) UnmarshalJSON(data []byte) error

type GeoShapeQueryParams

type GeoShapeQueryParams struct {
	Field          string
	Name           string
	Relation       SpatialRelation
	Shape          interface{}
	IndexedShape   *IndexedShape
	IgnoreUnmapped bool
	// contains filtered or unexported fields
}

func (GeoShapeQueryParams) Clause

func (p GeoShapeQueryParams) Clause() (QueryClause, error)

func (GeoShapeQueryParams) Complete

func (GeoShapeQueryParams) Complete()

func (GeoShapeQueryParams) GeoShape

func (p GeoShapeQueryParams) GeoShape() (*GeoShapeQuery, error)

func (GeoShapeQueryParams) Kind

type GeoShaper

type GeoShaper interface {
	GeoShape() (*GeoShapeQuery, error)
}

type HalfFloatField

type HalfFloatField struct {
	// contains filtered or unexported fields
}

A HalfFloatField is a half-precision 16-bit IEEE 754 floating point number, restricted to finite values.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewHalfFloatField

func NewHalfFloatField(params HalfFloatFieldParams) (*HalfFloatField, error)

func (HalfFloatField) Boost

func (b HalfFloatField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (HalfFloatField) Coerce

func (cp HalfFloatField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (HalfFloatField) DocValues

func (dv HalfFloatField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*HalfFloatField) Field

func (hf *HalfFloatField) Field() (Field, error)

func (HalfFloatField) IgnoreMalformed

func (im HalfFloatField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (HalfFloatField) Index

func (i HalfFloatField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (HalfFloatField) MarshalJSON

func (hf HalfFloatField) MarshalJSON() ([]byte, error)

func (HalfFloatField) Meta

func (m HalfFloatField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (HalfFloatField) NullValue

func (nv HalfFloatField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*HalfFloatField) SetBoost

func (b *HalfFloatField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*HalfFloatField) SetCoerce

func (cp *HalfFloatField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*HalfFloatField) SetDocValues

func (dv *HalfFloatField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*HalfFloatField) SetIgnoreMalformed

func (im *HalfFloatField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*HalfFloatField) SetIndex

func (i *HalfFloatField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*HalfFloatField) SetMeta

func (m *HalfFloatField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*HalfFloatField) SetNullValue

func (nv *HalfFloatField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*HalfFloatField) SetStore

func (sa *HalfFloatField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (HalfFloatField) Store

func (sa HalfFloatField) Store() bool

Store returns the StoreAttr Value or false

func (HalfFloatField) Type

func (HalfFloatField) Type() FieldType

func (*HalfFloatField) UnmarshalJSON

func (hf *HalfFloatField) UnmarshalJSON(data []byte) error

type HalfFloatFieldParams

type HalfFloatFieldParams numberFieldParams

func (HalfFloatFieldParams) Field

func (l HalfFloatFieldParams) Field() (Field, error)

func (HalfFloatFieldParams) HalfFloat

func (l HalfFloatFieldParams) HalfFloat() (*HalfFloatField, error)

func (HalfFloatFieldParams) Type

type HasChildQuery

type HasChildQuery struct {
	// contains filtered or unexported fields
}

func (*HasChildQuery) Clause

func (q *HasChildQuery) Clause() (QueryClause, error)

func (*HasChildQuery) Clear

func (q *HasChildQuery) Clear()

func (HasChildQuery) Complete

func (HasChildQuery) Complete()

func (*HasChildQuery) HasChild

func (q *HasChildQuery) HasChild() (*HasChildQuery, error)

func (HasChildQuery) IgnoreUnmapped

func (q HasChildQuery) IgnoreUnmapped() bool

func (*HasChildQuery) IsEmpty

func (q *HasChildQuery) IsEmpty() bool

func (HasChildQuery) Kind

func (HasChildQuery) Kind() QueryKind

func (HasChildQuery) MarshalBSON

func (q HasChildQuery) MarshalBSON() ([]byte, error)

func (HasChildQuery) MarshalJSON

func (q HasChildQuery) MarshalJSON() ([]byte, error)

func (*HasChildQuery) MaxChildren

func (q *HasChildQuery) MaxChildren() int

func (*HasChildQuery) MinChildren

func (q *HasChildQuery) MinChildren() int

func (HasChildQuery) Name

func (n HasChildQuery) Name() string

func (HasChildQuery) Query

func (q HasChildQuery) Query() *Query

func (HasChildQuery) ScoreMode

func (q HasChildQuery) ScoreMode() ScoreMode

func (*HasChildQuery) SetIgnoreUnmapped

func (q *HasChildQuery) SetIgnoreUnmapped(ignoreUnmapped interface{}) error

func (*HasChildQuery) SetMaxChildren

func (q *HasChildQuery) SetMaxChildren(max interface{}) error

func (*HasChildQuery) SetMinChildren

func (q *HasChildQuery) SetMinChildren(min interface{}) error

func (*HasChildQuery) SetName

func (n *HasChildQuery) SetName(name string)

func (*HasChildQuery) SetQuery

func (q *HasChildQuery) SetQuery(query Querier) error

func (*HasChildQuery) SetScoreMode

func (q *HasChildQuery) SetScoreMode(sm ScoreMode) error

func (*HasChildQuery) SetType

func (q *HasChildQuery) SetType(typ string) error

func (HasChildQuery) Type

func (q HasChildQuery) Type() string

func (*HasChildQuery) UnmarshalBSON

func (q *HasChildQuery) UnmarshalBSON(data []byte) error

func (*HasChildQuery) UnmarshalJSON

func (q *HasChildQuery) UnmarshalJSON(data []byte) error

type HasChildQueryParams

type HasChildQueryParams struct {
	// (Required, string) Name of the child relationship mapped for the join
	// field.
	Type string
	// (Required, query object) Query you wish to run on child documents of the
	// type field. If a child document matches the search, the query returns the
	// parent document.
	Query Querier
	// (Optional, Boolean) Indicates whether to ignore an unmapped type and not
	// return any documents instead of an error. Defaults to false. If false,
	// Elasticsearch returns an error if the type is unmapped.
	//
	// You can use this parameter to query multiple indices that may not contain
	// the type.
	IgnoreUnmapped interface{}
	// (Optional, integer) Maximum number of child documents that match the
	// query allowed for a returned parent document. If the parent document
	// exceeds this limit, it is excluded from the search results.
	MaxChildren interface{}
	// (Optional, integer) Minimum number of child documents that match the
	// query required to match the query for a returned parent document. If the
	// parent document does not meet this limit, it is excluded from the search
	// results.
	MinChildren interface{}
	// (Optional, string) Indicates how scores for matching child documents affect the root parent document’s relevance score. Valid values are:
	// none (Default)
	// Do not use the relevance scores of matching child documents. The query assigns parent documents a score of 0.
	// avg
	// Use the mean relevance score of all matching child documents.
	// max
	// Uses the highest relevance score of all matching child documents.
	// min
	// Uses the lowest relevance score of all matching child documents.
	// sum
	// Add together the relevance scores of all matching child documents.
	ScoreMode ScoreMode
	Name      string
	// contains filtered or unexported fields
}

func (HasChildQueryParams) Clause

func (p HasChildQueryParams) Clause() (QueryClause, error)

func (HasChildQueryParams) Complete

func (HasChildQueryParams) Complete()

func (HasChildQueryParams) HasChild

func (p HasChildQueryParams) HasChild() (*HasChildQuery, error)

func (HasChildQueryParams) Kind

type HasChilder

type HasChilder interface {
	HasChild() (*HasChildQuery, error)
}

type HasParentQuery

type HasParentQuery struct {
	// contains filtered or unexported fields
}

func (*HasParentQuery) Clause

func (q *HasParentQuery) Clause() (QueryClause, error)

func (*HasParentQuery) Clear

func (q *HasParentQuery) Clear()

func (HasParentQuery) Complete

func (HasParentQuery) Complete()

func (*HasParentQuery) HasParent

func (q *HasParentQuery) HasParent() (*HasParentQuery, error)

func (HasParentQuery) IgnoreUnmapped

func (q HasParentQuery) IgnoreUnmapped() bool

func (*HasParentQuery) IsEmpty

func (q *HasParentQuery) IsEmpty() bool

func (HasParentQuery) Kind

func (HasParentQuery) Kind() QueryKind

func (HasParentQuery) MarshalBSON

func (q HasParentQuery) MarshalBSON() ([]byte, error)

func (HasParentQuery) MarshalJSON

func (q HasParentQuery) MarshalJSON() ([]byte, error)

func (HasParentQuery) Name

func (n HasParentQuery) Name() string

func (HasParentQuery) ParentType

func (q HasParentQuery) ParentType() string

func (HasParentQuery) Query

func (q HasParentQuery) Query() *Query

func (HasParentQuery) Score

func (q HasParentQuery) Score() bool

func (*HasParentQuery) SetIgnoreUnmapped

func (q *HasParentQuery) SetIgnoreUnmapped(ignoreUnmapped interface{}) error

func (*HasParentQuery) SetName

func (n *HasParentQuery) SetName(name string)

func (*HasParentQuery) SetParentType

func (q *HasParentQuery) SetParentType(typ string) error

func (*HasParentQuery) SetQuery

func (q *HasParentQuery) SetQuery(query Querier) error

func (*HasParentQuery) SetScore

func (q *HasParentQuery) SetScore(score interface{}) error

func (*HasParentQuery) UnmarshalBSON

func (q *HasParentQuery) UnmarshalBSON(data []byte) error

func (*HasParentQuery) UnmarshalJSON

func (q *HasParentQuery) UnmarshalJSON(data []byte) error

type HasParentQueryParams

type HasParentQueryParams struct {
	ParentType string
	// (Required, query object) Query you wish to run on parent documents of the
	// parent_type field. If a parent document matches the search, the query
	// returns its child documents.
	Query Querier
	// (Optional, Boolean) Indicates whether to ignore an unmapped parent_type
	// and not return any documents instead of an error. Defaults to false.
	//
	// If false, Elasticsearch returns an error if the parent_type is unmapped.
	//
	// You can use this parameter to query multiple indices that may not contain
	// the parent_type.
	IgnoreUnmapped interface{}
	// (Optional, Boolean) Indicates whether the relevance score of a matching
	// parent document is aggregated into its child documents. Defaults to
	// false.
	//
	// If false, Elasticsearch ignores the relevance score of the parent
	// document. Elasticsearch also assigns each child document a relevance
	// score equal to the query's boost, which defaults to 1.
	//
	// If true, the relevance score of the matching parent document is
	// aggregated into its child documents' relevance scores.
	Score interface{}
	Name  string
	// contains filtered or unexported fields
}

func (HasParentQueryParams) Clause

func (p HasParentQueryParams) Clause() (QueryClause, error)

func (HasParentQueryParams) Complete

func (HasParentQueryParams) Complete()

func (HasParentQueryParams) HasParent

func (p HasParentQueryParams) HasParent() (*HasParentQuery, error)

func (HasParentQueryParams) Kind

type HasParenter

type HasParenter interface {
	HasParent() (*HasParentQuery, error)
}

type HistogramField

type HistogramField struct{}

func NewHistogramField

func NewHistogramField(params HistograpmFieldParams) (*HistogramField, error)

func (*HistogramField) Field

func (h *HistogramField) Field() (Field, error)

func (HistogramField) MarshalBSON

func (h HistogramField) MarshalBSON() ([]byte, error)

func (HistogramField) MarshalJSON

func (h HistogramField) MarshalJSON() ([]byte, error)

func (HistogramField) Type

func (HistogramField) Type() FieldType

func (*HistogramField) UnmarshalBSON

func (h *HistogramField) UnmarshalBSON(data []byte) error

func (*HistogramField) UnmarshalJSON

func (h *HistogramField) UnmarshalJSON(data []byte) error

type HistograpmFieldParams

type HistograpmFieldParams struct{}

func (HistograpmFieldParams) Field

func (p HistograpmFieldParams) Field() (Field, error)

func (HistograpmFieldParams) Histogram

func (p HistograpmFieldParams) Histogram() (*HistogramField, error)

func (HistograpmFieldParams) Type

type IDsQuery

type IDsQuery struct {
	// contains filtered or unexported fields
}

func (*IDsQuery) Clause

func (id *IDsQuery) Clause() (QueryClause, error)

func (*IDsQuery) Clear

func (id *IDsQuery) Clear()

func (IDsQuery) Complete

func (IDsQuery) Complete()

func (*IDsQuery) IDs

func (id *IDsQuery) IDs() (*IDsQuery, error)

func (*IDsQuery) IsEmpty

func (id *IDsQuery) IsEmpty() bool

func (IDsQuery) Kind

func (IDsQuery) Kind() QueryKind

func (IDsQuery) MarshalJSON

func (id IDsQuery) MarshalJSON() ([]byte, error)

func (IDsQuery) Name

func (n IDsQuery) Name() string

func (*IDsQuery) SetName

func (n *IDsQuery) SetName(name string)

func (*IDsQuery) SetValues

func (id *IDsQuery) SetValues(ids []string) error

func (*IDsQuery) UnmarshalJSON

func (id *IDsQuery) UnmarshalJSON(data []byte) error

func (IDsQuery) Values

func (id IDsQuery) Values() []string

type IDsQueryParams

type IDsQueryParams struct {
	// (Required) An array of document IDs.
	Values []string `json:"values"`
	Name   string   `json:"_name,omitempty"`
}

func (IDsQueryParams) Clause

func (p IDsQueryParams) Clause() (QueryClause, error)

func (IDsQueryParams) IDs

func (p IDsQueryParams) IDs() (*IDsQuery, error)

func (IDsQueryParams) Kind

func (IDsQueryParams) Kind() QueryKind

type IDser

type IDser interface {
	IDs() (*IDsQuery, error)
}

type IPField

type IPField struct {
	// contains filtered or unexported fields
}

An IPField can index/store either IPv4 or IPv6 addresses.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ip.html

func NewIPField

func NewIPField(params IPFieldParams) (*IPField, error)

func (IPField) Boost

func (b IPField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (IPField) DocValues

func (dv IPField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*IPField) Field

func (ip *IPField) Field() (Field, error)

func (IPField) IgnoreMalformed

func (im IPField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (IPField) Index

func (i IPField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (IPField) MarshalJSON

func (ip IPField) MarshalJSON() ([]byte, error)

func (IPField) NullValue

func (nv IPField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*IPField) SetBoost

func (b *IPField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*IPField) SetDocValues

func (dv *IPField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*IPField) SetIgnoreMalformed

func (im *IPField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*IPField) SetIndex

func (i *IPField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*IPField) SetNullValue

func (nv *IPField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*IPField) SetStore

func (sa *IPField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (IPField) Store

func (sa IPField) Store() bool

Store returns the StoreAttr Value or false

func (IPField) Type

func (IPField) Type() FieldType

func (*IPField) UnmarshalJSON

func (ip *IPField) UnmarshalJSON(data []byte) error

type IPFieldParams

type IPFieldParams struct {
	// IgnoreMalformed determines if malformed numbers are ignored. If true,
	// malformed numbers are ignored. If false (default), malformed numbers
	// throw an exception and reject the whole document.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// (Optional, bool, default: true)
	//
	// Most fields are indexed by default, which makes them searchable. The
	// inverted index allows queries to look up the search term in unique sorted
	// list of terms, and from that immediately have access to the list of
	// documents that contain the term.
	//
	// Sorting, aggregations, and access to field values in scripts requires a
	// different data access pattern. Instead of looking up the term and finding
	// documents, we need to be able to look up the document and find the terms
	// that it has in a field.
	//
	// Doc values are the on-disk data structure, built at document index time,
	// which makes this data access pattern possible. They store the same values
	// as the _source but in a column-oriented fashion that is way more
	// efficient for sorting and aggregations. Doc values are supported on
	// almost all field types, with the notable exception of text and
	// annotated_text fields.
	//
	// All fields which support doc values have them enabled by default. If you
	// are sure that you don’t need to sort or aggregate on a field, or access
	// the field value from a script, you can disable doc values in order to
	// save disk space
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
	DocValues interface{} `json:"doc_values,omitempty"`
	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool)
	Index interface{} `json:"index,omitempty"`
	// NullValue parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	NullValue interface{} `json:"null_value,omitempty"`
	// WithStore is a mapping with a store paramter.
	//
	// By default, field values are indexed to make them searchable, but they
	// are not stored. This means that the field can be queried, but the
	// original field value cannot be retrieved.
	//
	// Usually this doesn’t matter. The field value is already part of the
	// _source field, which is stored by default. If you only want to retrieve
	// the value of a single field or of a few fields, instead of the whole
	// _source, then this can be achieved with source filtering.
	//
	// In certain situations it can make sense to store a field. For instance,
	// if you have a document with a title, a date, and a very large content
	// field, you may want to retrieve just the title and the date without
	// having to extract those fields from a large _source field
	//
	// Stored fields returned as arrays
	//
	// For consistency, stored fields are always returned as an array because
	// there is no way of knowing if the original field value was a single
	// value, multiple values, or an empty array.
	//
	// The original value can be retrieved from the _source field instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
	Store interface{} `json:"store,omitempty"`

	// Deprecated
	Boost interface{} `json:"boost,omitempty"`
}

func (IPFieldParams) Field

func (p IPFieldParams) Field() (Field, error)

func (IPFieldParams) IP

func (p IPFieldParams) IP() (*IPField, error)

func (IPFieldParams) Type

func (IPFieldParams) Type() FieldType

type IPRangeField

type IPRangeField struct {
	// contains filtered or unexported fields
}

IPRangeField is a range of ip values supporting either IPv4 or IPv6 (or mixed) addresses.

func NewIPRangeField

func NewIPRangeField(params IPRangeFieldParams) (*IPRangeField, error)

func (IPRangeField) Coerce

func (cp IPRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*IPRangeField) Field

func (r *IPRangeField) Field() (Field, error)

func (IPRangeField) Index

func (i IPRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (IPRangeField) MarshalBSON

func (r IPRangeField) MarshalBSON() ([]byte, error)

func (IPRangeField) MarshalJSON

func (r IPRangeField) MarshalJSON() ([]byte, error)

func (*IPRangeField) SetCoerce

func (cp *IPRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*IPRangeField) SetIndex

func (i *IPRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*IPRangeField) SetStore

func (sa *IPRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (IPRangeField) Store

func (sa IPRangeField) Store() bool

Store returns the StoreAttr Value or false

func (IPRangeField) Type

func (IPRangeField) Type() FieldType

func (*IPRangeField) UnmarshalBSON

func (r *IPRangeField) UnmarshalBSON(data []byte) error

func (*IPRangeField) UnmarshalJSON

func (r *IPRangeField) UnmarshalJSON(data []byte) error

type IPRangeFieldParams

type IPRangeFieldParams rangeFieldParams

func (IPRangeFieldParams) Field

func (p IPRangeFieldParams) Field() (Field, error)

func (IPRangeFieldParams) IPRange

func (p IPRangeFieldParams) IPRange() (*IPRangeField, error)

func (IPRangeFieldParams) Type

type Index

type Index struct {
	Mappings FieldMappings `json:"mappings"`
	Settings map[string]interface{}
}

func NewIndex

func NewIndex(params IndexParams) (*Index, error)

func (Index) Encode

func (i Index) Encode() (*bytes.Buffer, error)

func (Index) MarshalBSON

func (i Index) MarshalBSON() ([]byte, error)

func (Index) MarshalJSON

func (i Index) MarshalJSON() ([]byte, error)

func (*Index) UnmarshalBSON

func (i *Index) UnmarshalBSON(data []byte) error

func (*Index) UnmarshalJSON

func (i *Index) UnmarshalJSON(data []byte) error

type IndexOptions

type IndexOptions string

IndexOptions controls what information is added to the inverted index for search and highlighting purposes.

const (
	IndexOptionsUnspecified IndexOptions = ""
	// IndexOptionsDocs - Only the doc number is indexed. Can answer the
	// question Does this term exist in this field?
	IndexOptionsDocs IndexOptions = "docs"
	// IndexOptionsFreqs - Doc number and term frequencies are indexed. Term
	// frequencies are used to score repeated terms higher than single terms.
	IndexOptionsFreqs IndexOptions = "freqs"
	// IndexOptionsPositions - Doc number, term frequencies, and term positions
	// (or order) are indexed. Positions can be used for proximity or phrase
	// queries.
	IndexOptionsPositions IndexOptions = "positions"
	// IndexOptionsOffsets - Doc number, term frequencies, positions, and start and end character offsets
	// (which map the term back to the original string) are indexed. Offsets are
	// used by the unified highlighter to speed up highlighting.
	IndexOptionsOffsets IndexOptions = "offsets"
)

func (IndexOptions) String

func (io IndexOptions) String() string

type IndexParams

type IndexParams struct {
	Mappings Mappings
	Settings map[string]interface{}
}

func (IndexParams) Index

func (p IndexParams) Index() (*Index, error)

type IndexPrefixes

type IndexPrefixes struct {
	MinimumChars interface{} `json:"min_chars,omitempty"`
	MaximumChars interface{} `json:"max_chars,omitempty"`
}

type IndexSettingsParams

type IndexSettingsParams struct {
	// The number of primary shards that an index should have. Defaults to 1.
	// This setting can only be set at index creation time. It cannot be changed
	// on a closed index.
	NumberOfShards interface{}

	// Number of routing shards used to split an index.
	//
	// This setting’s default value depends on the number of primary shards in
	// the index. The default is designed to allow you to split by factors of 2
	// up to a maximum of 1024 shards.
	//
	// In Elasticsearch 7.0.0 and later versions, this setting affects how
	// documents are distributed across shards. When reindexing an older index
	// with custom routing, you must explicitly set
	// index.number_of_routing_shards to maintain the same document
	// distribution.
	NumberOfRoutingShards interface{}

	// Whether or not shards should be checked for corruption before opening.
	// When corruption is detected, it will prevent the shard from being opened.
	// Accepts:
	//
	//  "false"
	// (default) Don’t check for corruption when opening a shard.
	//  "checksum"
	// Check for physical corruption.
	//  "true"
	// Check for both physical and logical corruption. This is much more
	// expensive in terms of CPU and memory usage.
	ShardCheckOnStartup string

	// The default value compresses stored data with LZ4 compression, but this
	// can be set to best_compression which uses DEFLATE for a higher
	// compression ratio, at the expense of slower stored fields performance. If
	// you are updating the compression type, the new one will be applied after
	// segments are merged. Segment merging can be forced using force merge.
	Codec string

	// The number of shards a custom routing value can go to. Defaults to 1 and
	// can only be set at index creation time. This value must be less than the
	// index.number_of_shards unless the index.number_of_shards value is also 1.
	// See Routing to an index partition for more details about how this setting
	// is used.
	RoutingPartitionSize interface{}

	// Indicates whether soft deletes are enabled on the index. Soft deletes can
	// only be configured at index creation and only on indices created on or
	// after Elasticsearch 6.5.0. Defaults to true.
	//
	// Deprecated
	SoftDeletesEnabled interface{}

	// The maximum period to retain a shard history retention lease before it is
	// considered expired. Shard history retention leases ensure that soft
	// deletes are retained during merges on the Lucene index. If a soft delete
	// is merged away before it can be replicated to a follower the following
	// process will fail due to incomplete history on the leader. Defaults to
	// 12h.
	SoftDeletesRetentionLeasePeriod string

	// Indicates whether cached filters are pre-loaded for nested queries.
	// Possible values are true (default) and false.
	LoadFixedBitsetFiltersEagerly interface{}

	// Indicates whether the index should be hidden by default. Hidden indices
	// are not returned by default when using a wildcard expression. This
	// behavior is controlled per request through the use of the
	// expand_wildcards parameter. Possible values are true and false (default).
	Hidden interface{}

	// The number of replicas each primary shard has. Defaults to 1.
	NumberOfReplicas interface{}

	// Auto-expand the number of replicas based on the number of data nodes in
	// the cluster. Set to a dash delimited lower and upper bound (e.g. 0-5) or
	// use all for the upper bound (e.g. 0-all). Defaults to false (i.e.
	// disabled). Note that the auto-expanded number of replicas only takes
	// allocation filtering rules into account, but ignores any other allocation
	// rules such as shard allocation awareness and total shards per node, and
	// this can lead to the cluster health becoming YELLOW if the applicable
	// rules prevent all the replicas from being allocated.
	AutoExpandReplicas interface{}

	// How long a shard can not receive a search or get request until it’s
	// considered search idle. (default is 30s)
	SearchIdleAfter string

	// How often to perform a refresh operation, which makes recent changes to
	// the index visible to search. Defaults to 1s. Can be set to -1 to disable
	// refresh. If this setting is not explicitly set, shards that haven’t seen
	// search traffic for at least index.search.idle.after seconds will not
	// receive background refreshes until they receive a search request.
	// Searches that hit an idle shard where a refresh is pending will wait for
	// the next background refresh (within 1s). This behavior aims to
	// automatically optimize bulk indexing in the default case when no searches
	// are performed. In order to opt out of this behavior an explicit value of
	// 1s should set as the refresh interval.
	RefreshInterval string

	// The maximum value of from + size for searches to this index. Defaults to
	// 10000. Search requests take heap memory and time proportional to from +
	// size and this limits that memory.
	MaxResultWindow interface{}

	// The maximum value of from + size for inner hits definition and top hits
	// aggregations to this index. Defaults to 100. Inner hits and top hits
	// aggregation take heap memory and time proportional to from + size and
	// this limits that memory.
	MaxInnerResultWindow interface{}

	// The maximum value of window_size for rescore requests in searches of this
	// index. Defaults to index.max_result_window which defaults to 10000.
	// Search requests take heap memory and time proportional to
	// max(window_size, from + size) and this limits that memory.
	MaxRescoreWindow interface{}

	// The maximum number of docvalue_fields that are allowed in a query.
	// Defaults to 100. Doc-value fields are costly since they might incur a
	// per-field per-document seek.
	MaxDocvalueFieldsSearch interface{}

	// The maximum number of script_fields that are allowed in a query. Defaults
	// to 32.
	MaxScriptFields interface{}

	// The maximum allowed difference between min_gram and max_gram for
	// NGramTokenizer and NGramTokenFilter. Defaults to 1.
	MaxNgramDiff interface{}

	// The maximum allowed difference between max_shingle_size and
	// min_shingle_size for the shingle token filter. Defaults to 3.
	MaxShingleDiff interface{}

	// Maximum number of refresh listeners available on each shard of the index.
	// These listeners are used to implement refresh=wait_for.
	MaxRefreshListeners interface{}

	// The maximum number of tokens that can be produced using _analyze API.
	// Defaults to 10000.
	AnalyzeMaxTokenCount interface{}

	// The maximum number of characters that will be analyzed for a highlight
	// request. This setting is only applicable when highlighting is requested
	// on a text that was indexed without offsets or term vectors. Defaults to
	// 1000000.
	HighlightMaxAnalyzedOffset interface{}

	// The maximum number of terms that can be used in Terms Query. Defaults to
	// 65536.
	MaxTermsCount interface{}

	// The maximum length of regex that can be used in Regexp Query. Defaults to
	// 1000.
	MaxRegexLength interface{}

	// (string or array of strings) Wildcard (*) patterns matching one or more
	// fields. The following query types search these matching fields by
	// default:
	//
	// - More like this
	//
	// - Multi-match
	//
	// - Query string
	//
	// - Simple query string
	//
	// Defaults to *, which matches all fields eligible for term-level queries,
	// excluding metadata fields.
	QueryDefaultField interface{}

	// Controls shard allocation for this index. It can be set to:
	//
	//  "all" // (default) Allows shard allocation for all shards.
	//  "primaries" // Allows shard allocation only for primary shards.
	//  "new_primaries" // Allows shard allocation only for newly-created primary shards.
	//  "none" // No shard allocation is allowed.
	RoutingAllocationEnable string

	// Enables shard rebalancing for this index. It can be set to:
	//
	//  "all" // (default) - Allows shard rebalancing for all shards.
	//  "primaries" // Allows shard rebalancing only for primary shards.
	//  "replicas" // Allows shard rebalancing only for replica shards.
	//  "none" // No shard rebalancing is allowed.
	RoutingRebalanceEnable string

	// The length of time that a deleted document’s version number remains
	// available for further versioned operations. Defaults to 60s.
	GCDeletes interface{}

	// The default ingest node pipeline for this index. Index requests will fail
	// if the default pipeline is set and the pipeline does not exist. The
	// default may be overridden using the pipeline parameter. The special
	// pipeline name _none indicates no ingest pipeline should be run.
	DefaultPipeline string

	// The final ingest node pipeline for this index. Index requests will fail
	// if the final pipeline is set and the pipeline does not exist. The final
	// pipeline always runs after the request pipeline (if specified) and the
	// default pipeline (if it exists). The special pipeline name _none
	// indicates no ingest pipeline will run.
	FinalPipeline string
}

type IndexedShape

type IndexedShape struct {
	// The ID of the document that containing the pre-indexed shape.
	ID string `json:"id,omitempty"`
	// Name of the index where the pre-indexed shape is. Defaults to shapes.
	Index string `json:"index,omitempty"`
	// The field specified as path containing the pre-indexed shape. Defaults to
	// shape.
	Path string `json:"path,omitempty"`
	// The routing of the shape document if required.
	Routing string `json:"routing,omitempty"`
}

IndexedShape - The shape query supports using a shape which has already been indexed in another index. This is particularly useful for when you have a pre-defined list of shapes and you want to reference the list using a logical name (for example New Zealand) rather than having to provide coordinates each time

func (IndexedShape) MarshalEasyJSON

func (v IndexedShape) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (IndexedShape) MarshalJSON

func (v IndexedShape) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*IndexedShape) UnmarshalEasyJSON

func (v *IndexedShape) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*IndexedShape) UnmarshalJSON

func (v *IndexedShape) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type IntegerField

type IntegerField struct {
	// contains filtered or unexported fields
}

An IntegerField is a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewIntegerField

func NewIntegerField(params IntegerFieldParams) (*IntegerField, error)

func (IntegerField) Boost

func (b IntegerField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (IntegerField) Coerce

func (cp IntegerField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (IntegerField) DocValues

func (dv IntegerField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*IntegerField) Field

func (i *IntegerField) Field() (Field, error)

func (IntegerField) IgnoreMalformed

func (im IntegerField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (IntegerField) Index

func (i IntegerField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (IntegerField) MarshalBSON

func (i IntegerField) MarshalBSON() ([]byte, error)

func (IntegerField) MarshalJSON

func (i IntegerField) MarshalJSON() ([]byte, error)

func (IntegerField) Meta

func (m IntegerField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (IntegerField) NullValue

func (nv IntegerField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*IntegerField) SetBoost

func (b *IntegerField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*IntegerField) SetCoerce

func (cp *IntegerField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*IntegerField) SetDocValues

func (dv *IntegerField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*IntegerField) SetIgnoreMalformed

func (im *IntegerField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*IntegerField) SetIndex

func (i *IntegerField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*IntegerField) SetMeta

func (m *IntegerField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*IntegerField) SetNullValue

func (nv *IntegerField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*IntegerField) SetStore

func (sa *IntegerField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (IntegerField) Store

func (sa IntegerField) Store() bool

Store returns the StoreAttr Value or false

func (IntegerField) Type

func (IntegerField) Type() FieldType

func (*IntegerField) UnmarshalBSON

func (i *IntegerField) UnmarshalBSON(data []byte) error

func (*IntegerField) UnmarshalJSON

func (i *IntegerField) UnmarshalJSON(data []byte) error

type IntegerFieldParams

type IntegerFieldParams numberFieldParams

func (IntegerFieldParams) Field

func (p IntegerFieldParams) Field() (Field, error)

func (IntegerFieldParams) Integer

func (p IntegerFieldParams) Integer() (*IntegerField, error)

func (IntegerFieldParams) Type

type IntegerRangeField

type IntegerRangeField struct {
	// contains filtered or unexported fields
}

func NewIntegerRangeField

func NewIntegerRangeField(params IntegerRangeFieldParams) (*IntegerRangeField, error)

func (IntegerRangeField) Coerce

func (cp IntegerRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*IntegerRangeField) Field

func (r *IntegerRangeField) Field() (Field, error)

func (IntegerRangeField) Index

func (i IntegerRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (IntegerRangeField) MarshalBSON

func (r IntegerRangeField) MarshalBSON() ([]byte, error)

func (IntegerRangeField) MarshalJSON

func (r IntegerRangeField) MarshalJSON() ([]byte, error)

func (*IntegerRangeField) SetCoerce

func (cp *IntegerRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*IntegerRangeField) SetIndex

func (i *IntegerRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*IntegerRangeField) SetStore

func (sa *IntegerRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (IntegerRangeField) Store

func (sa IntegerRangeField) Store() bool

Store returns the StoreAttr Value or false

func (IntegerRangeField) Type

func (*IntegerRangeField) UnmarshalBSON

func (r *IntegerRangeField) UnmarshalBSON(data []byte) error

func (*IntegerRangeField) UnmarshalJSON

func (r *IntegerRangeField) UnmarshalJSON(data []byte) error

type IntegerRangeFieldParams

type IntegerRangeFieldParams rangeFieldParams

func (IntegerRangeFieldParams) Field

func (p IntegerRangeFieldParams) Field() (Field, error)

func (IntegerRangeFieldParams) IntegerRange

func (p IntegerRangeFieldParams) IntegerRange() (*IntegerRangeField, error)

func (IntegerRangeFieldParams) Type

type IntervalsQuery

type IntervalsQuery struct {
	// contains filtered or unexported fields
}

func (*IntervalsQuery) Clause

func (q *IntervalsQuery) Clause() (QueryClause, error)

func (*IntervalsQuery) Clear

func (q *IntervalsQuery) Clear()

func (IntervalsQuery) Complete

func (IntervalsQuery) Complete()

func (IntervalsQuery) Field

func (f IntervalsQuery) Field() string

func (*IntervalsQuery) Intervals

func (q *IntervalsQuery) Intervals() (*IntervalsQuery, error)

func (*IntervalsQuery) IsEmpty

func (q *IntervalsQuery) IsEmpty() bool

func (IntervalsQuery) Kind

func (IntervalsQuery) Kind() QueryKind

func (IntervalsQuery) MarshalBSON

func (q IntervalsQuery) MarshalBSON() ([]byte, error)

func (IntervalsQuery) MarshalJSON

func (q IntervalsQuery) MarshalJSON() ([]byte, error)

func (IntervalsQuery) Name

func (n IntervalsQuery) Name() string

func (*IntervalsQuery) Rule

func (q *IntervalsQuery) Rule() QueryRule

func (*IntervalsQuery) Set

func (q *IntervalsQuery) Set(field string, rule Ruler) error

func (*IntervalsQuery) SetField

func (f *IntervalsQuery) SetField(field string) error

func (*IntervalsQuery) SetName

func (n *IntervalsQuery) SetName(name string)

func (*IntervalsQuery) SetRule

func (q *IntervalsQuery) SetRule(rule Ruler) error

func (*IntervalsQuery) UnmarshalBSON

func (q *IntervalsQuery) UnmarshalBSON(data []byte) error

func (*IntervalsQuery) UnmarshalJSON

func (q *IntervalsQuery) UnmarshalJSON(data []byte) error

type IntervalsQueryParams

type IntervalsQueryParams struct {
	Field string `json:"field"`
	Name  string `json:"_name,omitempty"`
	Rule  Ruler  `json:"rule"`
}

func (IntervalsQueryParams) Clause

func (p IntervalsQueryParams) Clause() (QueryClause, error)

func (IntervalsQueryParams) Intervals

func (p IntervalsQueryParams) Intervals() (*IntervalsQuery, error)

func (IntervalsQueryParams) Kind

type Intervalser

type Intervalser interface {
	Intervals() (*IntervalsQuery, error)
}

type JoinField

type JoinField struct {
	// contains filtered or unexported fields
}

A JoinField is a special field that creates parent/child relation within documents of the same index. The relations section defines a set of possible relations within the documents, each relation being a parent name and a child name.

To index a document with a join, the name of the relation and the optional parent of the document must be provided in the source

When indexing parent documents, you can choose to specify just the name of the relation as a shortcut instead of encapsulating it in the normal object notation

When indexing a child, the name of the relation as well as the parent id of the document must be added in the _source.

WARNING

It is required to index the lineage of a parent in the same shard so you must always route child documents using their greater parent id.

Parent-join and performance

The join field shouldn’t be used like joins in a relation database. In Elasticsearch the key to good performance is to de-normalize your data into documents. Each join field, has_child or has_parent query adds a significant tax to your query performance. It can also trigger global ordinals to be built.

The only case where the join field makes sense is if your data contains a one-to-many relationship where one entity significantly outnumbers the other entity. An example of such case is a use case with products and offers for these products. In the case that offers significantly outnumbers the number of products then it makes sense to model the product as parent document and the offer as child document.

Parent-join restrictions

Only one join field mapping is allowed per index.

- Parent and child documents must be indexed on the same shard. This means that the same routing value needs to be provided when getting, deleting, or updating a child document.

- An element can have multiple children but only one parent.

- It is possible to add a new relation to an existing join field.

- It is also possible to add a child to an existing element but only if the element is already a parent.

Searching with parent-join

The parent-join creates one field to index the name of the relation within the document (my_parent, my_child, …​).

It also creates one field per parent/child relation. The name of this field is the name of the join field followed by # and the name of the parent in the relation. So for instance for the my_parent → [my_child, another_child] relation, the join field creates an additional field named my_join_field#my_parent.

This field contains the parent _id that the document links to if the document is a child (my_child or another_child) and the _id of document if it’s a parent (my_parent).

When searching an index that contains a join field, these two fields are always returned in the search response

Parent-join queries and aggregations

See the has_child and has_parent queries, the children aggregation, and inner hits for more information.

The value of the join field is accessible in aggregations and scripts, and may be queried with the parent_id query

Global ordinals

The join field uses global ordinals to speed up joins. Global ordinals need to be rebuilt after any change to a shard. The more parent id values are stored in a shard, the longer it takes to rebuild the global ordinals for the join field.

Global ordinals, by default, are built eagerly: if the index has changed, global ordinals for the join field will be rebuilt as part of the refresh. This can add significant time to the refresh. However most of the times this is the right trade-off, otherwise global ordinals are rebuilt when the first parent-join query or aggregation is used. This can introduce a significant latency spike for your users and usually this is worse as multiple global ordinals for the join field may be attempt rebuilt within a single refresh interval when many writes are occurring.

When the join field is used infrequently and writes occur frequently it may make sense to disable eager loading:

Multiple children per parent

It is also possible to define multiple children for a single parent

Using multiple levels of relations to replicate a relational model is not recommended. Each level of relation adds an overhead at query time in terms of memory and computation. You should de-normalize your data if you care about performance.

https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html

func NewJoinField

func NewJoinField(params JoinFieldParams) (*JoinField, error)

func (JoinField) EagerGlobalOrdinals

func (ego JoinField) EagerGlobalOrdinals() bool

To support aggregations and other operations that require looking up field values on a per-document basis, Elasticsearch uses a data structure called doc values. Term-based field types such as keyword store their doc values using an ordinal mapping for a more compact representation. This mapping works by assigning each term an incremental integer or ordinal based on its lexicographic order. The field’s doc values store only the ordinals for each document instead of the original terms, with a separate lookup structure to convert between ordinals and terms.

When used during aggregations, ordinals can greatly improve performance. As an example, the terms aggregation relies only on ordinals to collect documents into buckets at the shard-level, then converts the ordinals back to their original term values when combining results across shards.

Each index segment defines its own ordinal mapping, but aggregations collect data across an entire shard. So to be able to use ordinals for shard-level operations like aggregations, Elasticsearch creates a unified mapping called global ordinals. The global ordinal mapping is built on top of segment ordinals, and works by maintaining a map from global ordinal to the local ordinal for each segment.

Global ordinals are used if a search contains any of the following components:

- Certain bucket aggregations on keyword, ip, and flattened fields. This includes terms aggregations as mentioned above, as well as composite, diversified_sampler, and significant_terms.

- Bucket aggregations on text fields that require fielddata to be enabled.

- Operations on parent and child documents from a join field, including has_child queries and parent aggregations.

https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html

func (*JoinField) Field

func (j *JoinField) Field() (Field, error)

func (JoinField) MarshalBSON

func (j JoinField) MarshalBSON() ([]byte, error)

func (JoinField) MarshalJSON

func (j JoinField) MarshalJSON() ([]byte, error)

func (JoinField) Relations

func (r JoinField) Relations() Relations

Relations defines a set of possible relations within the documents, each relation being a parent name and a child name.

func (*JoinField) SetEagerGlobalOrdinals

func (ego *JoinField) SetEagerGlobalOrdinals(v interface{}) error

SetEagerGlobalOrdinals sets the eager_global_ordinals value to v

func (*JoinField) SetRelations

func (r *JoinField) SetRelations(v Relations)

SetRelations sets the value of Relations to v

func (JoinField) Type

func (JoinField) Type() FieldType

func (*JoinField) UnmarshalBSON

func (j *JoinField) UnmarshalBSON(data []byte) error

func (*JoinField) UnmarshalJSON

func (j *JoinField) UnmarshalJSON(data []byte) error

type JoinFieldParams

type JoinFieldParams struct {
	// Relations defines a set of possible relations within the documents, each
	// relation being a parent name and a child name.
	//
	// Use like a map[string]string:
	//  Relations{"myField": []string{"myValue"}}
	Relations Relations `json:"relations,omitempty"`
	// To support aggregations and other operations that require looking up field
	// values on a per-document basis, Elasticsearch uses a data structure called
	// doc values. Term-based field types such as keyword store their doc values
	// using an ordinal mapping for a more compact representation. This mapping
	// works by assigning each term an incremental integer or ordinal based on its
	// lexicographic order. The field’s doc values store only the ordinals for each
	// document instead of the original terms, with a separate lookup structure to
	// convert between ordinals and terms.
	//
	// When used during aggregations, ordinals can greatly improve performance. As
	// an example, the terms aggregation relies only on ordinals to collect
	// documents into buckets at the shard-level, then converts the ordinals back to
	// their original term values when combining results across shards.
	//
	// Each index segment defines its own ordinal mapping, but aggregations collect
	// data across an entire shard. So to be able to use ordinals for shard-level
	// operations like aggregations, Elasticsearch creates a unified mapping called
	// global ordinals. The global ordinal mapping is built on top of segment
	// ordinals, and works by maintaining a map from global ordinal to the local
	// ordinal for each segment.
	//
	// Global ordinals are used if a search contains any of the following
	// components:
	//
	// - Certain bucket aggregations on keyword, ip, and flattened fields. This
	// includes terms aggregations as mentioned above, as well as composite,
	// diversified_sampler, and significant_terms.
	//
	// - Bucket aggregations on text fields that require fielddata to be enabled.
	//
	// - Operations on parent and child documents from a join field, including
	// has_child queries and parent aggregations.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html
	EagerGlobalOrdinals interface{} `json:"eager_global_ordinals,omitempty"`
}

func (JoinFieldParams) Field

func (p JoinFieldParams) Field() (Field, error)

func (JoinFieldParams) Join

func (p JoinFieldParams) Join() (*JoinField, error)

func (JoinFieldParams) Type

func (JoinFieldParams) Type() FieldType

type KeywordField

type KeywordField struct {
	// contains filtered or unexported fields
}

KeywordField keyword, which is used for structured content such as IDs, email addresses, hostnames, status codes, zip codes, or tags.

https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#keyword-field-type

func NewKeywordField

func NewKeywordField(params KeywordFieldParams) (*KeywordField, error)

func (KeywordField) Boost

func (b KeywordField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (KeywordField) DocValues

func (dv KeywordField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (KeywordField) EagerGlobalOrdinals

func (ego KeywordField) EagerGlobalOrdinals() bool

To support aggregations and other operations that require looking up field values on a per-document basis, Elasticsearch uses a data structure called doc values. Term-based field types such as keyword store their doc values using an ordinal mapping for a more compact representation. This mapping works by assigning each term an incremental integer or ordinal based on its lexicographic order. The field’s doc values store only the ordinals for each document instead of the original terms, with a separate lookup structure to convert between ordinals and terms.

When used during aggregations, ordinals can greatly improve performance. As an example, the terms aggregation relies only on ordinals to collect documents into buckets at the shard-level, then converts the ordinals back to their original term values when combining results across shards.

Each index segment defines its own ordinal mapping, but aggregations collect data across an entire shard. So to be able to use ordinals for shard-level operations like aggregations, Elasticsearch creates a unified mapping called global ordinals. The global ordinal mapping is built on top of segment ordinals, and works by maintaining a map from global ordinal to the local ordinal for each segment.

Global ordinals are used if a search contains any of the following components:

- Certain bucket aggregations on keyword, ip, and flattened fields. This includes terms aggregations as mentioned above, as well as composite, diversified_sampler, and significant_terms.

- Bucket aggregations on text fields that require fielddata to be enabled.

- Operations on parent and child documents from a join field, including has_child queries and parent aggregations.

https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html

func (*KeywordField) Field

func (t *KeywordField) Field() (Field, error)

func (KeywordField) Fields

func (f KeywordField) Fields() Fields

Fields (Multi-fields) allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.

func (KeywordField) IgnoreAbove

func (ia KeywordField) IgnoreAbove() float64

IgnoreAbove signals to not index any string longer than this value. Defaults to 2147483647 so that all values would be accepted. Please however note that default dynamic mapping rules create a sub keyword field that overrides this default by setting ignore_above: 256.

func (KeywordField) Index

func (i KeywordField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (KeywordField) IndexOptions

func (io KeywordField) IndexOptions() IndexOptions

IndexOptions parameter controls what information is added to the inverted index for search and highlighting purposes.

func (KeywordField) MarshalBSON

func (t KeywordField) MarshalBSON() ([]byte, error)

func (KeywordField) MarshalJSON

func (t KeywordField) MarshalJSON() ([]byte, error)

func (KeywordField) Meta

func (m KeywordField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (KeywordField) Normalizer

func (n KeywordField) Normalizer() string

Normalizer property of keyword fields is similar to analyzer except that it guarantees that the analysis chain produces a single token.

func (KeywordField) Norms

func (n KeywordField) Norms() bool

Norms determines whether field-length should be taken into account when scoring queries. Accepts true (default) or false.

func (KeywordField) NullValue

func (nv KeywordField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*KeywordField) SetBoost

func (b *KeywordField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*KeywordField) SetDocValues

func (dv *KeywordField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*KeywordField) SetEagerGlobalOrdinals

func (ego *KeywordField) SetEagerGlobalOrdinals(v interface{}) error

SetEagerGlobalOrdinals sets the eager_global_ordinals value to v

func (*KeywordField) SetFields

func (f *KeywordField) SetFields(fields Fieldset) error

SetFields sets the Fields value to v

func (KeywordField) SetIgnoreAbove

func (ia KeywordField) SetIgnoreAbove(v interface{}) error

SetIgnoreAbove sets the IgnoreAbove value to v

func (*KeywordField) SetIndex

func (i *KeywordField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*KeywordField) SetIndexOptions

func (io *KeywordField) SetIndexOptions(v IndexOptions) error

SetIndexOptions sets IndexOptions value to v

func (*KeywordField) SetMeta

func (m *KeywordField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*KeywordField) SetNormalizer

func (n *KeywordField) SetNormalizer(v string)

SetNormalizer sets the Normalizer value to v

The normalizer property of keyword fields is similar to analyzer except that it guarantees that the analysis chain produces a single token.

func (*KeywordField) SetNorms

func (n *KeywordField) SetNorms(v interface{}) error

SetNorms sets the Norms value to v

func (*KeywordField) SetNullValue

func (nv *KeywordField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*KeywordField) SetSimilarity

func (s *KeywordField) SetSimilarity(v Similarity) error

SetSimilarity sets the Similarity Value to v

func (*KeywordField) SetSplitQueriesOnWhitespace

func (sq *KeywordField) SetSplitQueriesOnWhitespace(v interface{}) error

SetSplitQueriesOnWhitespace sets the SplitQueriesOnWhitespace Value to v

func (*KeywordField) SetStore

func (sa *KeywordField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (KeywordField) Similarity

func (s KeywordField) Similarity() Similarity

Similarity is mostly useful for text fields, but can also apply to other field types.

func (KeywordField) SplitQueriesOnWhitespace

func (sq KeywordField) SplitQueriesOnWhitespace() bool

SplitQueriesOnWhitespace determines whether full text queries should split the input on whitespace when building a query for this field. Accepts true or false (default).

func (KeywordField) Store

func (sa KeywordField) Store() bool

Store returns the StoreAttr Value or false

func (KeywordField) Type

func (KeywordField) Type() FieldType

func (*KeywordField) UnmarshalBSON

func (t *KeywordField) UnmarshalBSON(data []byte) error

func (*KeywordField) UnmarshalJSON

func (t *KeywordField) UnmarshalJSON(data []byte) error

type KeywordFieldParams

type KeywordFieldParams struct {
	// Should the field be stored on disk in a column-stride fashion, so that it
	// can later be used for sorting, aggregations, or scripting? Accepts true
	// (default) or false.
	DocValues interface{} `json:"doc_values,omitempty"`
	// Should global ordinals be loaded eagerly on refresh? Accepts true or false
	// (default). Enabling this is a good idea on fields that are frequently used
	// for (significant) terms aggregations.
	EagerGlobalOrdinals interface{} `json:"eager_global_ordinals,omitempty"`
	// Multi-fields allow the same string value to be indexed in multiple ways
	// for different purposes, such as one field for search and a multi-field
	// for sorting and aggregations, or the same string value analyzed by
	// different analyzers.
	Fields FieldMap `json:"fields,omitempty"`
	// Should the field be searchable? Accepts true (default) or false.
	Index interface{} `json:"index,omitempty"`
	// What information should be stored in the index, for search and
	// highlighting purposes. Defaults to positions
	IndexOptions IndexOptions `json:"index_options,omitempty"`
	// Whether field-length should be taken into account when scoring queries.
	// Accepts true (default) or false.
	Norms interface{} `json:"norms,omitempty"`
	// Do not index any string longer than this value. Defaults to 2147483647 so
	// that all values would be accepted. Please however note that default
	// dynamic mapping rules create a sub keyword field that overrides this
	// default by setting ignore_above: 256.
	IgnoreAbove interface{} `json:"ignore_above,omitempty"`
	// Accepts a string value which is substituted for any explicit null values.
	// Defaults to null, which means the field is treated as missing.
	NullValue interface{} `json:"null_value,omitempty"`
	// Whether the field value should be stored and retrievable separately from
	// the _source field. Accepts true or false (default).
	Store interface{} `json:"store,omitempty"`
	// Which scoring algorithm or similarity should be used. Defaults to BM25.
	Similarity Similarity `json:"similarity,omitempty"`
	// Metadata about the field.
	Meta Meta `json:"meta,omitempty"`
	// How to pre-process the keyword prior to indexing. Defaults to null,
	// meaning the keyword is kept as-is.
	Normalizer string `json:"normalizer,omitempty"`
	// Whether full text queries should split the input on whitespace when
	// building a query for this field. Accepts true or false (default).
	SplitQueriesOnWhitespace interface{} `json:"split_queries_on_whitespace,omitempty"`

	// Deprecated
	//
	// Mapping field-level query time boosting. Accepts a floating point number,
	// defaults to 1.0.
	Boost interface{} `json:"boost,omitempty"`
}

func (KeywordFieldParams) Field

func (p KeywordFieldParams) Field() (Field, error)

func (KeywordFieldParams) Keyword

func (p KeywordFieldParams) Keyword() (*KeywordField, error)

func (KeywordFieldParams) Type

type LatLon

type LatLon struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

LatLon properties

func (LatLon) MarshalEasyJSON

func (v LatLon) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (LatLon) MarshalJSON

func (v LatLon) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*LatLon) UnmarshalEasyJSON

func (v *LatLon) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*LatLon) UnmarshalJSON

func (v *LatLon) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type LinearDecayFunction

type LinearDecayFunction struct {
	// contains filtered or unexported fields
}

func (*LinearDecayFunction) Decay

func (l *LinearDecayFunction) Decay() dynamic.Number

func (*LinearDecayFunction) Field

func (l *LinearDecayFunction) Field() string

func (LinearDecayFunction) Filter

func (l LinearDecayFunction) Filter() QueryClause

func (LinearDecayFunction) FuncKind

func (LinearDecayFunction) FuncKind() FuncKind

func (LinearDecayFunction) MarshalBSON

func (l LinearDecayFunction) MarshalBSON() ([]byte, error)

func (LinearDecayFunction) MarshalJSON

func (l LinearDecayFunction) MarshalJSON() ([]byte, error)

func (*LinearDecayFunction) Offset

func (LinearDecayFunction) Origin

func (l LinearDecayFunction) Origin() interface{}

func (LinearDecayFunction) Scale

func (*LinearDecayFunction) SetDecay

func (l *LinearDecayFunction) SetDecay(value interface{}) error

func (*LinearDecayFunction) SetField

func (l *LinearDecayFunction) SetField(field string) error

func (*LinearDecayFunction) SetFilter

func (l *LinearDecayFunction) SetFilter(c CompleteClauser) error

func (*LinearDecayFunction) SetOffset

func (l *LinearDecayFunction) SetOffset(offset interface{}) error

func (*LinearDecayFunction) SetOrigin

func (l *LinearDecayFunction) SetOrigin(origin interface{}) error

func (*LinearDecayFunction) SetScale

func (l *LinearDecayFunction) SetScale(scale interface{}) error

func (*LinearDecayFunction) SetWeight

func (b *LinearDecayFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*LinearDecayFunction) Weight

func (b *LinearDecayFunction) Weight() float64

type LinearDecayFunctionParams

type LinearDecayFunctionParams struct {
	// Field
	Field string
	// Weight (float)
	Weight interface{}
	// The point of origin used for calculating distance. Must be given as a
	// number for numeric field, date for date fields and geo point for geo
	// fields. Required for geo and numeric field. For date fields the default
	// is now. Date math (for example now-1h) is supported for origin.
	Origin interface{}
	// Required for all types. Defines the distance from origin + offset at
	// which the computed score will equal decay parameter. For geo fields: Can
	// be defined as number+unit (1km, 12m,…​). Default unit is meters. For date
	// fields: Can to be defined as a number+unit ("1h", "10d",…​). Default unit
	// is milliseconds. For numeric field: Any number.
	Scale interface{}
	// 	If an offset is defined, the decay function will only compute the decay
	// 	function for documents with a distance greater than the defined offset.
	// 	The default is 0.
	Offset interface{}
	// The decay parameter defines how documents are scored at the distance
	// given at scale. If no decay is defined, documents at the distance scale
	// will be scored 0.5.
	Decay  interface{}
	Filter CompleteClauser
}

func (LinearDecayFunctionParams) FuncKind

func (LinearDecayFunctionParams) Function

func (l LinearDecayFunctionParams) Function() (Function, error)

type LinearFunction

type LinearFunction struct{}

LinearFunction for RankFeatureQuery.

func (*LinearFunction) Linear

func (l *LinearFunction) Linear() (*LinearFunction, error)

func (LinearFunction) MarshalBSON

func (l LinearFunction) MarshalBSON() ([]byte, error)

func (LinearFunction) MarshalJSON

func (l LinearFunction) MarshalJSON() ([]byte, error)

func (*LinearFunction) UnmarshalBSON

func (l *LinearFunction) UnmarshalBSON(data []byte) error

func (*LinearFunction) UnmarshalJSON

func (l *LinearFunction) UnmarshalJSON(data []byte) error

type LinearFunctionParams

type LinearFunctionParams struct{}

func (LinearFunctionParams) Linear

func (p LinearFunctionParams) Linear() (*LinearFunction, error)

type LinearFunctioner

type LinearFunctioner interface {
	Linear() (*LinearFunction, error)
}

type LogFunction

type LogFunction struct {
	// contains filtered or unexported fields
}

LogFunction is a logarithmic function used to boost relevance scores based on the value of the rank feature field.

func (*LogFunction) Log

func (l *LogFunction) Log() (*LogFunction, error)

func (LogFunction) MarshalJSON

func (l LogFunction) MarshalJSON() ([]byte, error)

func (LogFunction) ScalingFactor

func (sf LogFunction) ScalingFactor() float64

ScalingFactor to use when encoding values. Values will be multiplied by this factor at index time and rounded to the closest long value. For instance, a scaled_float with a scaling_factor of 10 would internally store 2.34 as 23 and all search-time operations (queries, aggregations, sorting) will behave as if the document had a value of 2.3. High values of scaling_factor improve accuracy but also increase space requirements. This parameter is required.

func (*LogFunction) SetScalingFactor

func (sf *LogFunction) SetScalingFactor(v interface{}) error

SetScalingFactor sets the ScalingFactorValue to v

func (*LogFunction) UnmarshalJSON

func (l *LogFunction) UnmarshalJSON(data []byte) error

type LogFunctionParams

type LogFunctionParams struct {
	ScalingFactor interface{}
}

func (LogFunctionParams) Log

func (p LogFunctionParams) Log() (*LogFunction, error)

type LogFunctioner

type LogFunctioner interface {
	Log() (*LogFunction, error)
}

type LongField

type LongField struct {
	// contains filtered or unexported fields
}

A LongField is a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewLongField

func NewLongField(params LongFieldParams) (*LongField, error)

func (LongField) Boost

func (b LongField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (LongField) Coerce

func (cp LongField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (LongField) DocValues

func (dv LongField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*LongField) Field

func (l *LongField) Field() (Field, error)

func (LongField) IgnoreMalformed

func (im LongField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (LongField) Index

func (i LongField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (LongField) MarshalBSON

func (l LongField) MarshalBSON() ([]byte, error)

func (LongField) MarshalJSON

func (l LongField) MarshalJSON() ([]byte, error)

func (LongField) Meta

func (m LongField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (LongField) NullValue

func (nv LongField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*LongField) SetBoost

func (b *LongField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*LongField) SetCoerce

func (cp *LongField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*LongField) SetDocValues

func (dv *LongField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*LongField) SetIgnoreMalformed

func (im *LongField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*LongField) SetIndex

func (i *LongField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*LongField) SetMeta

func (m *LongField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*LongField) SetNullValue

func (nv *LongField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*LongField) SetStore

func (sa *LongField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (LongField) Store

func (sa LongField) Store() bool

Store returns the StoreAttr Value or false

func (LongField) Type

func (LongField) Type() FieldType

func (*LongField) UnmarshalBSON

func (l *LongField) UnmarshalBSON(data []byte) error

func (*LongField) UnmarshalJSON

func (l *LongField) UnmarshalJSON(data []byte) error

type LongFieldParams

type LongFieldParams numberFieldParams

LongFieldParams - field for a signed 64-bit integer with a minimum value of -263 and a maximum value of 263-1.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func (LongFieldParams) Field

func (l LongFieldParams) Field() (Field, error)

func (LongFieldParams) Long

func (l LongFieldParams) Long() (*LongField, error)

func (LongFieldParams) Type

func (LongFieldParams) Type() FieldType

type LongRangeField

type LongRangeField struct {
	// contains filtered or unexported fields
}

LongRangeField is a range of signed 64-bit integers with a minimum value of -263 and maximum of 263-1.

func NewLongRangeField

func NewLongRangeField(params LongRangeFieldParams) (*LongRangeField, error)

func (LongRangeField) Coerce

func (cp LongRangeField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (*LongRangeField) Field

func (r *LongRangeField) Field() (Field, error)

func (LongRangeField) Index

func (i LongRangeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (LongRangeField) MarshalBSON

func (r LongRangeField) MarshalBSON() ([]byte, error)

func (LongRangeField) MarshalJSON

func (r LongRangeField) MarshalJSON() ([]byte, error)

func (*LongRangeField) SetCoerce

func (cp *LongRangeField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*LongRangeField) SetIndex

func (i *LongRangeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*LongRangeField) SetStore

func (sa *LongRangeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (LongRangeField) Store

func (sa LongRangeField) Store() bool

Store returns the StoreAttr Value or false

func (LongRangeField) Type

func (LongRangeField) Type() FieldType

func (*LongRangeField) UnmarshalBSON

func (r *LongRangeField) UnmarshalBSON(data []byte) error

func (*LongRangeField) UnmarshalJSON

func (r *LongRangeField) UnmarshalJSON(data []byte) error

type LongRangeFieldParams

type LongRangeFieldParams rangeFieldParams

func (LongRangeFieldParams) Field

func (p LongRangeFieldParams) Field() (Field, error)

func (LongRangeFieldParams) LongRange

func (p LongRangeFieldParams) LongRange() (*LongRangeField, error)

func (LongRangeFieldParams) Type

type Lookup

type Lookup struct {
	Field string
	// Name of the index from which to fetch field
	// values.(Required)
	Index string

	// ID of the document from which to fetch field
	// values. (Required)
	ID string

	// Path of the field from which to fetch field values. Elasticsearch
	// uses these values as search terms for the query.(Required)
	//
	// If the field values include an array of nested inner objects, you can
	// access those objects using dot notation syntax.
	Path string

	// Routing value of the document from which to fetch term values. If a
	// custom routing value was provided when the document was indexed, this
	// parameter is required. (Optional)
	Routing string

	Boost interface{}

	CaseInsensitive bool

	QueryName string
}

func (Lookup) Clause

func (l Lookup) Clause() (QueryClause, error)

func (Lookup) Kind

func (l Lookup) Kind() QueryKind

func (Lookup) Name

func (l Lookup) Name() string

func (Lookup) Terms

func (l Lookup) Terms() (*TermsQuery, error)

type LookupValues

type LookupValues struct {
	// contains filtered or unexported fields
}

func (LookupValues) ID

func (l LookupValues) ID() string

func (*LookupValues) Index

func (l *LookupValues) Index() string

func (LookupValues) IsEmpty

func (l LookupValues) IsEmpty() bool

func (LookupValues) MarshalBSON

func (l LookupValues) MarshalBSON() ([]byte, error)

func (LookupValues) MarshalJSON

func (l LookupValues) MarshalJSON() ([]byte, error)

func (*LookupValues) Path

func (l *LookupValues) Path() string

func (LookupValues) Routing

func (l LookupValues) Routing() string

func (*LookupValues) SetID

func (l *LookupValues) SetID(id string) error

func (*LookupValues) SetIndex

func (l *LookupValues) SetIndex(index string) error

func (*LookupValues) SetPath

func (l *LookupValues) SetPath(path string) error

func (LookupValues) SetRouting

func (l LookupValues) SetRouting(routing string)

func (*LookupValues) UnmarshalBSON

func (l *LookupValues) UnmarshalBSON(data []byte) error

func (*LookupValues) UnmarshalJSON

func (l *LookupValues) UnmarshalJSON(data []byte) error

type MappingError

type MappingError struct {
	Errors []error
}

func (*MappingError) Append

func (e *MappingError) Append(err error)

func (*MappingError) Error

func (e *MappingError) Error() string

func (*MappingError) ErrorOrNil

func (e *MappingError) ErrorOrNil() error

ErrorOrNil returns an error interface if this Error represents a list of errors, or returns nil if the list of errors is empty. This function is useful at the end of accumulation to make sure that the value returned represents the existence of errors.

func (*MappingError) GoString

func (e *MappingError) GoString() string

func (*MappingError) Unwrap

func (e *MappingError) Unwrap() error

Unwrap returns an error from Error (or nil if there are no errors). This error returned will further support Unwrap to get the next error, etc. The order will match the order of Errors in the multierror.Error at the time of calling.

The resulting error supports errors.As/Is/Unwrap so you can continue to use the stdlib errors package to introspect further.

This will perform a shallow copy of the errors slice. Any errors appended to this error after calling Unwrap will not be available until a new Unwrap is called on the multierror.Error.

func (*MappingError) WrappedErrors

func (e *MappingError) WrappedErrors() []error

WrappedErrors returns the list of errors that this Error is wrapping. It is an implementation of the errwrap.Wrapper interface so that multierror.Error can be used with that library.

This method is not safe to be called concurrently. Unlike accessing the Errors field directly, this function also checks if the multierror is nil to prevent a null-pointer panic. It satisfies the errwrap.Wrapper interface.

type Mappings

type Mappings struct {
	Properties FieldMap `json:"properties"`
}

func (Mappings) FieldMappings

func (m Mappings) FieldMappings() (FieldMappings, error)

func (*Mappings) MarshalJSON

func (m *Mappings) MarshalJSON() ([]byte, error)

func (*Mappings) UnmarshalBSON

func (m *Mappings) UnmarshalBSON(data []byte) error

func (*Mappings) UnmarshalJSON

func (m *Mappings) UnmarshalJSON(data []byte) error

type MatchAllQuery

type MatchAllQuery struct {
	// contains filtered or unexported fields
}

MatchAllQuery matches all documents, giving them all a _score of 1.0.

func (MatchAllQuery) Boost

func (b MatchAllQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (MatchAllQuery) Clause

func (ma MatchAllQuery) Clause() (QueryClause, error)

func (*MatchAllQuery) Clear

func (ma *MatchAllQuery) Clear()

func (MatchAllQuery) Complete

func (MatchAllQuery) Complete()

func (*MatchAllQuery) Disable

func (ma *MatchAllQuery) Disable()

func (*MatchAllQuery) Enable

func (ma *MatchAllQuery) Enable()

func (*MatchAllQuery) IsEmpty

func (ma *MatchAllQuery) IsEmpty() bool

func (MatchAllQuery) Kind

func (MatchAllQuery) Kind() QueryKind

func (MatchAllQuery) MarshalJSON

func (ma MatchAllQuery) MarshalJSON() ([]byte, error)

func (*MatchAllQuery) MatchAll

func (ma *MatchAllQuery) MatchAll() (*MatchAllQuery, error)

func (MatchAllQuery) Name

func (n MatchAllQuery) Name() string

func (*MatchAllQuery) SetBoost

func (b *MatchAllQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*MatchAllQuery) SetName

func (n *MatchAllQuery) SetName(name string)

func (*MatchAllQuery) UnmarshalJSON

func (ma *MatchAllQuery) UnmarshalJSON(data []byte) error

type MatchAllQueryParams

type MatchAllQueryParams struct {
	Boost interface{}
	Name  string
	// contains filtered or unexported fields
}

MatchAllQueryParams matches all documents, giving them all a _score of 1.0.

func (MatchAllQueryParams) Clause

func (ma MatchAllQueryParams) Clause() (QueryClause, error)

func (MatchAllQueryParams) Complete

func (MatchAllQueryParams) Complete()

func (MatchAllQueryParams) Kind

func (ma MatchAllQueryParams) Kind() QueryKind

func (MatchAllQueryParams) MatchAll

func (ma MatchAllQueryParams) MatchAll() (*MatchAllQuery, error)

type MatchBoolPrefixQuery

type MatchBoolPrefixQuery struct {
	// contains filtered or unexported fields
}

func (MatchBoolPrefixQuery) Analyzer

func (ap MatchBoolPrefixQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (*MatchBoolPrefixQuery) Clause

func (m *MatchBoolPrefixQuery) Clause() (QueryClause, error)

func (*MatchBoolPrefixQuery) Clear

func (m *MatchBoolPrefixQuery) Clear()

func (MatchBoolPrefixQuery) Complete

func (MatchBoolPrefixQuery) Complete()

func (MatchBoolPrefixQuery) DefaultFuzzyRewrite

func (f MatchBoolPrefixQuery) DefaultFuzzyRewrite() Rewrite

func (MatchBoolPrefixQuery) Field

func (f MatchBoolPrefixQuery) Field() string

func (MatchBoolPrefixQuery) Fuzziness

func (f MatchBoolPrefixQuery) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (MatchBoolPrefixQuery) FuzzyRewrite

func (f MatchBoolPrefixQuery) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (MatchBoolPrefixQuery) FuzzyTranspositions

func (ft MatchBoolPrefixQuery) FuzzyTranspositions() bool

FuzzyTranspositions edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

func (*MatchBoolPrefixQuery) IsEmpty

func (m *MatchBoolPrefixQuery) IsEmpty() bool

func (MatchBoolPrefixQuery) Kind

func (MatchBoolPrefixQuery) MarshalBSON

func (m MatchBoolPrefixQuery) MarshalBSON() ([]byte, error)

func (MatchBoolPrefixQuery) MarshalJSON

func (m MatchBoolPrefixQuery) MarshalJSON() ([]byte, error)

func (*MatchBoolPrefixQuery) MatchBoolPrefix

func (m *MatchBoolPrefixQuery) MatchBoolPrefix() (*MatchBoolPrefixQuery, error)

func (MatchBoolPrefixQuery) MaxExpansions

func (me MatchBoolPrefixQuery) MaxExpansions() int

MaxExpansions is the maximum number of variations created. Defaults to 50.

func (MatchBoolPrefixQuery) MinimumShouldMatch

func (msm MatchBoolPrefixQuery) MinimumShouldMatch() string

func (MatchBoolPrefixQuery) Name

func (n MatchBoolPrefixQuery) Name() string

func (MatchBoolPrefixQuery) Operator

func (o MatchBoolPrefixQuery) Operator() Operator

Operator is the boolean logic used to interpret text in the query value. Defaults to Or

func (MatchBoolPrefixQuery) PrefixLength

func (pl MatchBoolPrefixQuery) PrefixLength() int

func (MatchBoolPrefixQuery) Query

func (m MatchBoolPrefixQuery) Query() string

func (*MatchBoolPrefixQuery) SetAnalyzer

func (ap *MatchBoolPrefixQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MatchBoolPrefixQuery) SetField

func (f *MatchBoolPrefixQuery) SetField(field string) error

func (*MatchBoolPrefixQuery) SetFuzziness

func (f *MatchBoolPrefixQuery) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*MatchBoolPrefixQuery) SetFuzzyRewrite

func (f *MatchBoolPrefixQuery) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*MatchBoolPrefixQuery) SetFuzzyTranspositions

func (ft *MatchBoolPrefixQuery) SetFuzzyTranspositions(fuzzyTranspositions interface{}) error

SetFuzzyTranspositions sets FuzzyTranspositions to v

func (*MatchBoolPrefixQuery) SetMaxExpansions

func (me *MatchBoolPrefixQuery) SetMaxExpansions(v interface{}) error

func (*MatchBoolPrefixQuery) SetMinimumShouldMatch

func (msm *MatchBoolPrefixQuery) SetMinimumShouldMatch(v string)

func (*MatchBoolPrefixQuery) SetName

func (n *MatchBoolPrefixQuery) SetName(name string)

func (*MatchBoolPrefixQuery) SetOperator

func (o *MatchBoolPrefixQuery) SetOperator(v Operator) error

SetOperator sets the Operator to v

func (*MatchBoolPrefixQuery) SetPrefixLength

func (pl *MatchBoolPrefixQuery) SetPrefixLength(v interface{}) error

func (*MatchBoolPrefixQuery) SetQuery

func (m *MatchBoolPrefixQuery) SetQuery(query string) error

func (*MatchBoolPrefixQuery) UnmarshalBSON

func (m *MatchBoolPrefixQuery) UnmarshalBSON(data []byte) error

func (*MatchBoolPrefixQuery) UnmarshalJSON

func (m *MatchBoolPrefixQuery) UnmarshalJSON(data []byte) error

type MatchBoolPrefixQueryParams

type MatchBoolPrefixQueryParams struct {
	Query               string
	Field               string
	MinimumShouldMatch  string
	Operator            Operator
	Analyzer            string
	Fuzziness           string
	PrefixLength        interface{}
	FuzzyTranspositions interface{}
	FuzzyRewrite        Rewrite
	MaxExpansions       interface{}
	Name                string
	// contains filtered or unexported fields
}

func (MatchBoolPrefixQueryParams) Clause

func (MatchBoolPrefixQueryParams) Complete

func (MatchBoolPrefixQueryParams) Complete()

func (MatchBoolPrefixQueryParams) Kind

func (MatchBoolPrefixQueryParams) MatchBoolPrefix

func (p MatchBoolPrefixQueryParams) MatchBoolPrefix() (*MatchBoolPrefixQuery, error)

type MatchBoolPrefixer

type MatchBoolPrefixer interface {
	MatchBoolPrefix() (*MatchBoolPrefixQuery, error)
}

type MatchNoneQuery

type MatchNoneQuery struct {
	// contains filtered or unexported fields
}

MatchNoneQuery is the inverse of the match_all query, which matches no documents.

func (MatchNoneQuery) Boost

func (b MatchNoneQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*MatchNoneQuery) Clause

func (mn *MatchNoneQuery) Clause() (QueryClause, error)

func (*MatchNoneQuery) Clear

func (mn *MatchNoneQuery) Clear()

func (MatchNoneQuery) Complete

func (MatchNoneQuery) Complete()

func (*MatchNoneQuery) Disable

func (mn *MatchNoneQuery) Disable()

func (*MatchNoneQuery) Enable

func (mn *MatchNoneQuery) Enable()

func (*MatchNoneQuery) IsEmpty

func (mn *MatchNoneQuery) IsEmpty() bool

func (MatchNoneQuery) Kind

func (MatchNoneQuery) Kind() QueryKind

func (MatchNoneQuery) MarshalJSON

func (mn MatchNoneQuery) MarshalJSON() ([]byte, error)

func (MatchNoneQuery) Name

func (n MatchNoneQuery) Name() string

func (*MatchNoneQuery) SetBoost

func (b *MatchNoneQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*MatchNoneQuery) SetName

func (n *MatchNoneQuery) SetName(name string)

func (*MatchNoneQuery) UnmarshalJSON

func (mn *MatchNoneQuery) UnmarshalJSON(data []byte) error

type MatchNoneQueryParams

type MatchNoneQueryParams struct {
	Name string
}

MatchNoneQueryParams is the inverse of the match_all query, which matches no documents.

func (MatchNoneQueryParams) Clause

func (mn MatchNoneQueryParams) Clause() (QueryClause, error)

func (MatchNoneQueryParams) Kind

func (mn MatchNoneQueryParams) Kind() QueryKind

func (MatchNoneQueryParams) MatchNone

func (mn MatchNoneQueryParams) MatchNone() (*MatchNoneQuery, error)

type MatchPhrasePrefixQuery

type MatchPhrasePrefixQuery struct {
	// contains filtered or unexported fields
}

MatchPhrasePrefixQuery returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.

https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-match-query-phrase-prefix.html

func (MatchPhrasePrefixQuery) Analyzer

func (ap MatchPhrasePrefixQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (*MatchPhrasePrefixQuery) Clause

func (m *MatchPhrasePrefixQuery) Clause() (QueryClause, error)

func (*MatchPhrasePrefixQuery) Clear

func (m *MatchPhrasePrefixQuery) Clear()

func (MatchPhrasePrefixQuery) Complete

func (MatchPhrasePrefixQuery) Complete()

func (MatchPhrasePrefixQuery) Field

func (f MatchPhrasePrefixQuery) Field() string

func (*MatchPhrasePrefixQuery) IsEmpty

func (m *MatchPhrasePrefixQuery) IsEmpty() bool

func (MatchPhrasePrefixQuery) Kind

func (MatchPhrasePrefixQuery) MarshalBSON

func (m MatchPhrasePrefixQuery) MarshalBSON() ([]byte, error)

func (MatchPhrasePrefixQuery) MarshalJSON

func (m MatchPhrasePrefixQuery) MarshalJSON() ([]byte, error)

func (*MatchPhrasePrefixQuery) MatchPhrasePrefix

func (m *MatchPhrasePrefixQuery) MatchPhrasePrefix() (*MatchPhrasePrefixQuery, error)

func (MatchPhrasePrefixQuery) MaxExpansions

func (me MatchPhrasePrefixQuery) MaxExpansions() int

MaxExpansions is the maximum number of variations created. Defaults to 50.

func (MatchPhrasePrefixQuery) Name

func (n MatchPhrasePrefixQuery) Name() string

func (MatchPhrasePrefixQuery) Query

func (m MatchPhrasePrefixQuery) Query() string

func (*MatchPhrasePrefixQuery) SetAnalyzer

func (ap *MatchPhrasePrefixQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MatchPhrasePrefixQuery) SetField

func (f *MatchPhrasePrefixQuery) SetField(field string) error

func (*MatchPhrasePrefixQuery) SetMaxExpansions

func (me *MatchPhrasePrefixQuery) SetMaxExpansions(v interface{}) error

func (*MatchPhrasePrefixQuery) SetName

func (n *MatchPhrasePrefixQuery) SetName(name string)

func (*MatchPhrasePrefixQuery) SetQuery

func (m *MatchPhrasePrefixQuery) SetQuery(query string) error

func (*MatchPhrasePrefixQuery) SetSlop

func (s *MatchPhrasePrefixQuery) SetSlop(v interface{}) error

func (*MatchPhrasePrefixQuery) SetZeroTermsQuery

func (ztq *MatchPhrasePrefixQuery) SetZeroTermsQuery(v ZeroTerms) error

func (MatchPhrasePrefixQuery) Slop

func (s MatchPhrasePrefixQuery) Slop() int

func (*MatchPhrasePrefixQuery) UnmarshalBSON

func (m *MatchPhrasePrefixQuery) UnmarshalBSON(data []byte) error

func (*MatchPhrasePrefixQuery) UnmarshalJSON

func (m *MatchPhrasePrefixQuery) UnmarshalJSON(data []byte) error

func (MatchPhrasePrefixQuery) ZeroTermsQuery

func (ztq MatchPhrasePrefixQuery) ZeroTermsQuery() ZeroTerms

ZeroTermsQuery indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-zero

type MatchPhrasePrefixQueryParams

type MatchPhrasePrefixQueryParams struct {
	// (Required, string) Text you wish to find in the provided <field>.
	//
	// The match_phrase_prefix query analyzes any provided text into tokens before
	// performing a search. The last term of this text is treated as a prefix,
	// matching any words that begin with that term.
	Query string
	// Field to query
	Field string
	// (Optional, integer) Maximum number of terms to which the last provided
	// term of the query value will expand. Defaults to 50.
	MaxExpansions interface{}
	// (Optional, integer) Maximum number of positions allowed between matching
	// tokens. Defaults to 0. Transposed terms have a slop of 2.
	Slop interface{}
	// (Optional, string) Indicates whether no documents are returned if the
	// analyzer removes all tokens, such as when using a stop filter. Valid
	// values are:
	ZeroTermsQuery ZeroTerms
	// (Optional, string) Analyzer used to convert text in the query value into
	// tokens. Defaults to the index-time analyzer mapped for the <field>. If no
	// analyzer is mapped, the index’s default analyzer is used.
	Analyzer string
	Name     string
	// contains filtered or unexported fields
}

func (MatchPhrasePrefixQueryParams) Clause

func (MatchPhrasePrefixQueryParams) Complete

func (MatchPhrasePrefixQueryParams) Complete()

func (MatchPhrasePrefixQueryParams) Kind

func (MatchPhrasePrefixQueryParams) MatchPhrasePrefix

func (p MatchPhrasePrefixQueryParams) MatchPhrasePrefix() (*MatchPhrasePrefixQuery, error)

type MatchPhrasePrefixer

type MatchPhrasePrefixer interface {
	MatchPhrasePrefix() (*MatchPhrasePrefixQuery, error)
}

type MatchPhraseQuery

type MatchPhraseQuery struct {
	// contains filtered or unexported fields
}

func (MatchPhraseQuery) Analyzer

func (ap MatchPhraseQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (*MatchPhraseQuery) Clause

func (m *MatchPhraseQuery) Clause() (QueryClause, error)

func (*MatchPhraseQuery) Clear

func (m *MatchPhraseQuery) Clear()

func (MatchPhraseQuery) Complete

func (MatchPhraseQuery) Complete()

func (MatchPhraseQuery) Field

func (f MatchPhraseQuery) Field() string

func (*MatchPhraseQuery) IsEmpty

func (m *MatchPhraseQuery) IsEmpty() bool

func (MatchPhraseQuery) Kind

func (MatchPhraseQuery) Kind() QueryKind

func (MatchPhraseQuery) MarshalBSON

func (m MatchPhraseQuery) MarshalBSON() ([]byte, error)

func (MatchPhraseQuery) MarshalJSON

func (m MatchPhraseQuery) MarshalJSON() ([]byte, error)

func (*MatchPhraseQuery) MatchPhrase

func (m *MatchPhraseQuery) MatchPhrase() (*MatchPhraseQuery, error)

func (MatchPhraseQuery) Name

func (n MatchPhraseQuery) Name() string

func (MatchPhraseQuery) Query

func (m MatchPhraseQuery) Query() string

func (*MatchPhraseQuery) SetAnalyzer

func (ap *MatchPhraseQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MatchPhraseQuery) SetField

func (f *MatchPhraseQuery) SetField(field string) error

func (*MatchPhraseQuery) SetName

func (n *MatchPhraseQuery) SetName(name string)

func (*MatchPhraseQuery) SetQuery

func (m *MatchPhraseQuery) SetQuery(query string) error

func (*MatchPhraseQuery) SetZeroTermsQuery

func (ztq *MatchPhraseQuery) SetZeroTermsQuery(v ZeroTerms) error

func (*MatchPhraseQuery) UnmarshalBSON

func (m *MatchPhraseQuery) UnmarshalBSON(data []byte) error

func (*MatchPhraseQuery) UnmarshalJSON

func (m *MatchPhraseQuery) UnmarshalJSON(data []byte) error

func (MatchPhraseQuery) ZeroTermsQuery

func (ztq MatchPhraseQuery) ZeroTermsQuery() ZeroTerms

ZeroTermsQuery indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-zero

type MatchPhraseQueryParams

type MatchPhraseQueryParams struct {
	Query          string
	Field          string
	Analyzer       string
	ZeroTermsQuery ZeroTerms
	Name           string
	// contains filtered or unexported fields
}

func (MatchPhraseQueryParams) Clause

func (MatchPhraseQueryParams) Complete

func (MatchPhraseQueryParams) Complete()

func (MatchPhraseQueryParams) Kind

func (MatchPhraseQueryParams) MatchPhrase

func (p MatchPhraseQueryParams) MatchPhrase() (*MatchPhraseQuery, error)

type MatchPhraser

type MatchPhraser interface {
	MatchPhrase() (*MatchPhraseQuery, error)
}

type MatchQuery

type MatchQuery struct {
	// contains filtered or unexported fields
}

MatchQuery returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching.

The match query is the standard query for performing a full-text search, including options for fuzzy matching.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

func (MatchQuery) Analyzer

func (ap MatchQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (MatchQuery) AutoGenerateSynonymsPhraseQuery

func (a MatchQuery) AutoGenerateSynonymsPhraseQuery() bool

AutoGenerateSynonymsPhraseQuery determines if match phrase queries are automatically created for multi-term synonyms. Defaults to true.

func (*MatchQuery) Clause

func (m *MatchQuery) Clause() (QueryClause, error)

func (*MatchQuery) Clear

func (m *MatchQuery) Clear()

func (MatchQuery) Complete

func (MatchQuery) Complete()

func (MatchQuery) CutoffFrequency

func (cf MatchQuery) CutoffFrequency() dynamic.Number

func (MatchQuery) DefaultFuzzyRewrite

func (f MatchQuery) DefaultFuzzyRewrite() Rewrite

func (MatchQuery) Field

func (f MatchQuery) Field() string

func (MatchQuery) Fuzziness

func (f MatchQuery) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (MatchQuery) FuzzyRewrite

func (f MatchQuery) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (MatchQuery) FuzzyTranspositions

func (ft MatchQuery) FuzzyTranspositions() bool

FuzzyTranspositions edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

func (*MatchQuery) IsEmpty

func (m *MatchQuery) IsEmpty() bool

func (MatchQuery) Kind

func (m MatchQuery) Kind() QueryKind

func (MatchQuery) Lenient

func (l MatchQuery) Lenient() bool

Lenient determines whether format-based errors, such as providing a text query value for a numeric field, are ignored. Defaults to false.

func (MatchQuery) MarshalBSON

func (m MatchQuery) MarshalBSON() ([]byte, error)

func (MatchQuery) MarshalJSON

func (m MatchQuery) MarshalJSON() ([]byte, error)

func (*MatchQuery) Match

func (m *MatchQuery) Match() (*MatchQuery, error)

func (MatchQuery) MaxExpansions

func (me MatchQuery) MaxExpansions() int

MaxExpansions is the maximum number of variations created. Defaults to 50.

func (MatchQuery) MinimumShouldMatch

func (msm MatchQuery) MinimumShouldMatch() string

func (MatchQuery) Name

func (n MatchQuery) Name() string

func (MatchQuery) Operator

func (o MatchQuery) Operator() Operator

Operator is the boolean logic used to interpret text in the query value. Defaults to Or

func (MatchQuery) PrefixLength

func (pl MatchQuery) PrefixLength() int

func (*MatchQuery) Query

func (*MatchQuery) Set

func (m *MatchQuery) Set(field string, match Matcher) error

func (*MatchQuery) SetAnalyzer

func (ap *MatchQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MatchQuery) SetAutoGenerateSynonymsPhraseQuery

func (a *MatchQuery) SetAutoGenerateSynonymsPhraseQuery(v interface{}) error

SetAutoGenerateSynonymsPhraseQuery sets AutoGenerateSynonymsPhraseQueryValue to v

func (*MatchQuery) SetCutoffFreuency

func (cf *MatchQuery) SetCutoffFreuency(n dynamic.Number)

func (*MatchQuery) SetField

func (f *MatchQuery) SetField(field string) error

func (*MatchQuery) SetFuzziness

func (f *MatchQuery) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*MatchQuery) SetFuzzyRewrite

func (f *MatchQuery) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*MatchQuery) SetFuzzyTranspositions

func (ft *MatchQuery) SetFuzzyTranspositions(fuzzyTranspositions interface{}) error

SetFuzzyTranspositions sets FuzzyTranspositions to v

func (*MatchQuery) SetLenient

func (l *MatchQuery) SetLenient(v bool)

SetLenient sets Lenient to v

func (*MatchQuery) SetMaxExpansions

func (me *MatchQuery) SetMaxExpansions(v interface{}) error

func (*MatchQuery) SetMinimumShouldMatch

func (msm *MatchQuery) SetMinimumShouldMatch(v string)

func (*MatchQuery) SetName

func (n *MatchQuery) SetName(name string)

func (*MatchQuery) SetOperator

func (o *MatchQuery) SetOperator(v Operator) error

SetOperator sets the Operator to v

func (*MatchQuery) SetPrefixLength

func (pl *MatchQuery) SetPrefixLength(v interface{}) error

func (*MatchQuery) SetQuery

func (m *MatchQuery) SetQuery(query interface{}) error

SetQuery sets the Match's query param. It returns an error if it is nil or empty. If you need to clear match, use Clear()

func (*MatchQuery) SetZeroTermsQuery

func (ztq *MatchQuery) SetZeroTermsQuery(v ZeroTerms) error

func (*MatchQuery) UnmarshalBSON

func (m *MatchQuery) UnmarshalBSON(data []byte) error

func (*MatchQuery) UnmarshalJSON

func (m *MatchQuery) UnmarshalJSON(data []byte) error

func (MatchQuery) ZeroTermsQuery

func (ztq MatchQuery) ZeroTermsQuery() ZeroTerms

ZeroTermsQuery indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-zero

type MatchQueryParams

type MatchQueryParams struct {
	// Each query accepts a _name in its top level definition. You can use named
	// queries to track which queries matched returned documents. If named
	// queries are used, the response includes a matched_queries property for
	// each hit.
	Name string
	// The field which is being matched.
	//
	// If you are setting Match explicitly, this does not need to be set. It
	// does, however, if you are adding it to a set of Clauses.
	Field string
	// (Required) Text, number, boolean or date you wish to find in the
	// provided <field>.
	//
	// The match query analyzes any provided text before performing a picker.
	// This means the match query can search text fields for analyzed tokens
	// rather than an exact term.
	Query interface{}
	// Analyzer used to convert the text in the query value into tokens.
	// Defaults to the index-time analyzer mapped for the <field>. If no
	// analyzer is mapped, the index’s default analyzer is used.
	Analyzer string
	// If true, match phrase queries are NOT automatically created for
	// multi-term synonyms.
	AutoGenerateSynonymsPhraseQuery interface{}
	// If true, edits for fuzzy matching DO NOT include transpositions of two
	// adjacent characters (ab → ba).
	FuzzyTranspositions interface{}
	// Maximum edit distance allowed for matching.
	Fuzziness    string
	FuzzyRewrite Rewrite
	//  If true, format-based errors, such as providing a text query value for a
	//  numeric field, are ignored. Defaults to false.
	Lenient bool
	// Boolean logic used to interpret text in the query value. Defaults to OR
	Operator Operator
	// Maximum number of terms to which the query will expand. Defaults to 50.
	MaxExpansions interface{}
	// Number of beginning characters left unchanged for fuzzy matching.
	// Defaults to 0.
	PrefixLength interface{}
	// Minimum number of clauses that must match for a document to be returned
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html
	MinimumShouldMatchParam string
	// Indicates whether no documents are returned if the analyzer removes all
	// tokens, such as when using a stop filter.
	ZeroTermsQuery ZeroTerms

	// The match query supports a cutoff_frequency that allows specifying an
	// absolute or relative document frequency where high frequency terms are
	// moved into an optional subquery and are only scored if one of the low
	// frequency (below the cutoff) terms in the case of an or operator or all
	// of the low frequency terms in the case of an and operator match.
	//
	// DEPRECATED in 7.3.0
	//
	// This option can be omitted as the Match can skip blocks of documents
	// efficiently, without any configuration, provided that the total number of
	// hits is not tracked.
	CutoffFrequency interface{}
	// contains filtered or unexported fields
}

MatchQueryParams returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching.

The match query is the standard query for performing a full-text search, including options for fuzzy matching.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

func (MatchQueryParams) Clause

func (m MatchQueryParams) Clause() (QueryClause, error)

func (MatchQueryParams) Complete

func (MatchQueryParams) Complete()

func (MatchQueryParams) Kind

func (m MatchQueryParams) Kind() QueryKind

func (MatchQueryParams) Match

func (m MatchQueryParams) Match() (*MatchQuery, error)

type MatchRule

type MatchRule struct {
	// contains filtered or unexported fields
}

func (MatchRule) Analyzer

func (ap MatchRule) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (MatchRule) Filter

func (r MatchRule) Filter() *RuleFilter

func (MatchRule) MarshalBSON

func (m MatchRule) MarshalBSON() ([]byte, error)

func (MatchRule) MarshalJSON

func (m MatchRule) MarshalJSON() ([]byte, error)

func (MatchRule) MaxGaps

func (mg MatchRule) MaxGaps() int

func (MatchRule) Ordered

func (o MatchRule) Ordered() bool

func (*MatchRule) Query

func (m *MatchRule) Query() string

func (*MatchRule) Rule

func (m *MatchRule) Rule() (QueryRule, error)

func (*MatchRule) SetAnalyzer

func (ap *MatchRule) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MatchRule) SetFilter

func (r *MatchRule) SetFilter(filter RuleFilterer) error

func (*MatchRule) SetMaxGaps

func (mg *MatchRule) SetMaxGaps(maxGaps interface{}) error

func (*MatchRule) SetOrdered

func (o *MatchRule) SetOrdered(ordered interface{}) error

func (*MatchRule) SetQuery

func (m *MatchRule) SetQuery(query string) error

func (*MatchRule) SetUseField

func (uf *MatchRule) SetUseField(field string)

func (MatchRule) Type

func (MatchRule) Type() RuleType

func (*MatchRule) UnmarshalBSON

func (m *MatchRule) UnmarshalBSON(data []byte) error

func (*MatchRule) UnmarshalJSON

func (m *MatchRule) UnmarshalJSON(data []byte) error

func (MatchRule) UseField

func (uf MatchRule) UseField() string

type MatchRuleParams

type MatchRuleParams struct {
	// (Required) Text you wish to find in the provided <field>.
	Query string `json:"query"`
	// (Optional, integer) Maximum number of positions between the matching
	// terms. Terms further apart than this are not considered matches. Defaults
	// to -1.
	//
	// If unspecified or set to -1, there is no width restriction on the match.
	// If set to 0, the terms must appear next to each other.
	MaxGaps interface{} `json:"max_gaps,omitempty"`
	// (Optional, Boolean) If true, matching terms must appear in their
	// specified order. Defaults to false.
	Ordered interface{} `json:"ordered,omitempty"`
	// (Optional, string) analyzer used to analyze terms in the query. Defaults
	// to the top-level <field>'s analyzer.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional, interval filter rule object) An optional interval filter.
	Filter RuleFilterer `json:"filter,omitempty"`
	// (Optional, string) If specified, then match intervals from this field
	// rather than the top-level <field>. Terms are analyzed using the search
	// analyzer from this field. This allows you to search across multiple
	// fields as if they were all the same field; for example, you could index
	// the same text into stemmed and unstemmed fields, and search for stemmed
	// tokens near unstemmed ones.
	UseField string `json:"use_field,omitempty"`
}

func (MatchRuleParams) MatchRule

func (p MatchRuleParams) MatchRule() (*MatchRule, error)

func (MatchRuleParams) Rule

func (p MatchRuleParams) Rule() (QueryRule, error)

func (MatchRuleParams) Type

func (MatchRuleParams) Type() RuleType

type MatchRuler

type MatchRuler interface {
	MatchRule(*MatchRule, error)
}

type Matcher

type Matcher interface {
	Match() (*MatchQuery, error)
}

type Meta

type Meta map[string]string

func (Meta) Exists

func (m Meta) Exists(key string) bool

func (Meta) Get

func (m Meta) Get(key string) string

func (Meta) Has

func (m Meta) Has(key string) bool

func (Meta) IsValid

func (m Meta) IsValid() bool

func (*Meta) Len

func (m *Meta) Len() int

func (*Meta) MetricType

func (m *Meta) MetricType() string

MetricType is the type of a numeric field: "gauge" || "counter". A gauge is a single-value measurement that can go up or down over time, such as a temperature. A counter is a single-value cumulative counter that only goes up, such as the number of requests processed by a web server. By default, no metric type is associated with a field. Only valid for numeric fields.

func (*Meta) Set

func (m *Meta) Set(key string, value string) error

func (*Meta) SetMetricType

func (m *Meta) SetMetricType(v string) error

func (*Meta) SetUnit

func (m *Meta) SetUnit(v string) error

func (*Meta) Unit

func (m *Meta) Unit() string

Unit associated with a numeric field: "percent", "byte" or a time unit. By default, a field does not have a unit. Only valid for numeric fields. The convention for percents is to use value 1 to mean 100%.

func (Meta) Validate

func (m Meta) Validate() error

func (*Meta) Value

func (m *Meta) Value(key string) (string, bool)

type Modifier

type Modifier string
const (
	ModifierUnspecified Modifier = ""
	// Do not apply any multiplier to the field value
	ModifierNone Modifier = "none"

	// Take the common logarithm of the field value. Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use log1p instead.
	ModifierLog Modifier = "log"

	//	Add 1 to the field value and take the common logarithm
	ModifierLog1P Modifier = "log1p"

	//Add 2 to the field value and take the common logarithm
	ModifierLog2P Modifier = "log2p"

	// Take the natural logarithm of the field value. Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use ln1p instead.
	ModifierLn Modifier = "ln"

	// Add 1 to the field value and take the natural logarithm
	ModifierLn1P Modifier = "ln1p"

	// Add 2 to the field value and take the natural logarithm
	ModifierLn2P Modifier = "ln2p"

	// Square the field value (multiply it by itself)
	ModifierSquare Modifier = "square"

	// Take the square root of the field value
	ModifierSqrt Modifier = "sqrt"

	//Reciprocate the field value, same as 1/x where x is the field’s value
	ModifierReciprocal Modifier = "reciprocal"
)

func (*Modifier) IsValid

func (m *Modifier) IsValid() bool

func (Modifier) String

func (m Modifier) String() string

type MoreLikeThisQuery

type MoreLikeThisQuery struct {
	// contains filtered or unexported fields
}

func (MoreLikeThisQuery) Analyzer

func (ap MoreLikeThisQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (MoreLikeThisQuery) Boost

func (b MoreLikeThisQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (MoreLikeThisQuery) BoostTerms

func (q MoreLikeThisQuery) BoostTerms() float64

func (*MoreLikeThisQuery) Clause

func (q *MoreLikeThisQuery) Clause() (QueryClause, error)

func (*MoreLikeThisQuery) Clear

func (q *MoreLikeThisQuery) Clear()

func (MoreLikeThisQuery) Complete

func (MoreLikeThisQuery) Complete()

func (MoreLikeThisQuery) FailOnUnsupportedField

func (q MoreLikeThisQuery) FailOnUnsupportedField() bool

func (MoreLikeThisQuery) Fields

func (q MoreLikeThisQuery) Fields() []string

func (MoreLikeThisQuery) Include

func (q MoreLikeThisQuery) Include() bool

func (*MoreLikeThisQuery) IsEmpty

func (q *MoreLikeThisQuery) IsEmpty() bool

func (MoreLikeThisQuery) Kind

func (MoreLikeThisQuery) Like

func (q MoreLikeThisQuery) Like() interface{}

func (MoreLikeThisQuery) MarshalBSON

func (q MoreLikeThisQuery) MarshalBSON() ([]byte, error)

func (MoreLikeThisQuery) MarshalJSON

func (q MoreLikeThisQuery) MarshalJSON() ([]byte, error)

func (MoreLikeThisQuery) MaxDocFrequency

func (q MoreLikeThisQuery) MaxDocFrequency() float64

func (MoreLikeThisQuery) MaxQueryTerms

func (q MoreLikeThisQuery) MaxQueryTerms() int

func (MoreLikeThisQuery) MaxWordLength

func (q MoreLikeThisQuery) MaxWordLength() int

func (MoreLikeThisQuery) MinDocFrequency

func (q MoreLikeThisQuery) MinDocFrequency() float64

func (MoreLikeThisQuery) MinTermFrequency

func (q MoreLikeThisQuery) MinTermFrequency() float64

func (MoreLikeThisQuery) MinWordLength

func (q MoreLikeThisQuery) MinWordLength() int

func (MoreLikeThisQuery) MinimumShouldMatch

func (msm MoreLikeThisQuery) MinimumShouldMatch() string

func (*MoreLikeThisQuery) MoreLikeThis

func (q *MoreLikeThisQuery) MoreLikeThis() (*MoreLikeThisQuery, error)

func (MoreLikeThisQuery) Name

func (n MoreLikeThisQuery) Name() string

func (*MoreLikeThisQuery) SetAnalyzer

func (ap *MoreLikeThisQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MoreLikeThisQuery) SetBoost

func (b *MoreLikeThisQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*MoreLikeThisQuery) SetBoostTerms

func (q *MoreLikeThisQuery) SetBoostTerms(v interface{}) error

func (*MoreLikeThisQuery) SetFailOnUnsupportedField

func (q *MoreLikeThisQuery) SetFailOnUnsupportedField(v interface{}) error

func (*MoreLikeThisQuery) SetFields

func (q *MoreLikeThisQuery) SetFields(fields []string)

func (*MoreLikeThisQuery) SetInclude

func (q *MoreLikeThisQuery) SetInclude(v interface{}) error

func (*MoreLikeThisQuery) SetLike

func (q *MoreLikeThisQuery) SetLike(like interface{}) error

func (*MoreLikeThisQuery) SetMaxDocFrequency

func (q *MoreLikeThisQuery) SetMaxDocFrequency(v interface{}) error

func (*MoreLikeThisQuery) SetMaxQueryTerms

func (q *MoreLikeThisQuery) SetMaxQueryTerms(v interface{}) error

func (*MoreLikeThisQuery) SetMaxWordLength

func (q *MoreLikeThisQuery) SetMaxWordLength(v interface{}) error

func (*MoreLikeThisQuery) SetMinDocFrequency

func (q *MoreLikeThisQuery) SetMinDocFrequency(v interface{}) error

func (*MoreLikeThisQuery) SetMinTermFrequency

func (q *MoreLikeThisQuery) SetMinTermFrequency(v interface{}) error

func (*MoreLikeThisQuery) SetMinWordLength

func (q *MoreLikeThisQuery) SetMinWordLength(v interface{}) error

func (*MoreLikeThisQuery) SetMinimumShouldMatch

func (msm *MoreLikeThisQuery) SetMinimumShouldMatch(v string)

func (*MoreLikeThisQuery) SetName

func (n *MoreLikeThisQuery) SetName(name string)

func (*MoreLikeThisQuery) SetStopWords

func (q *MoreLikeThisQuery) SetStopWords(stopWords []string)

func (*MoreLikeThisQuery) SetUnlike

func (q *MoreLikeThisQuery) SetUnlike(unlike interface{})

func (MoreLikeThisQuery) StopWords

func (q MoreLikeThisQuery) StopWords() []string

func (MoreLikeThisQuery) Unlike

func (q MoreLikeThisQuery) Unlike() interface{}

func (*MoreLikeThisQuery) UnmarshalBSON

func (q *MoreLikeThisQuery) UnmarshalBSON(data []byte) error

func (*MoreLikeThisQuery) UnmarshalJSON

func (q *MoreLikeThisQuery) UnmarshalJSON(data []byte) error

type MoreLikeThisQueryParams

type MoreLikeThisQueryParams struct {
	Name string

	// The only required parameter of the MLT query is like and follows a
	// versatile syntax, in which the user can specify free form text and/or a
	// single or multiple documents (see examples above). The syntax to specify
	// documents is similar to the one used by the Multi GET API. When
	// specifying documents, the text is fetched from fields unless overridden
	// in each document request. The text is analyzed by the analyzer at the
	// field, but could also be overridden. The syntax to override the analyzer
	// at the field follows a similar syntax to the per_field_analyzer parameter
	// of the Term Vectors API. Additionally, to provide documents not
	// necessarily present in the index, artificial documents are also
	// supported.
	Like interface{}
	// The unlike parameter is used in conjunction with like in order not to
	// select terms found in a chosen set of documents. In other words, we could
	// ask for documents like: "Apple", but unlike: "cake crumble tree". The
	// syntax is the same as like.
	Unlike interface{}
	// A list of fields to fetch and analyze the text from. Defaults to the
	// index.query.default_field index setting, which has a default value of *.
	// The * value matches all fields eligible for term-level queries, excluding
	// metadata fields.
	Fields []string
	// The maximum number of query terms that will be selected. Increasing this
	// value gives greater accuracy at the expense of query execution speed.
	// Defaults to 25.
	MaxQueryTerms interface{}
	// The minimum term frequency below which the terms will be ignored from the
	// input document. Defaults to 2.
	MinTermFrequency interface{}
	// The minimum document frequency below which the terms will be ignored from
	// the input document. Defaults to 5.
	MinDocFrequency interface{}
	// The maximum document frequency above which the terms will be ignored from
	// the input document. This could be useful in order to ignore highly
	// frequent words such as stop words. Defaults to unbounded
	// (Integer.MAX_VALUE, which is 2^31-1 or 2147483647).
	MaxDocFrequency interface{}
	// The minimum word length below which the terms will be ignored. Defaults
	// to 0.
	MinWordLength interface{}
	// The maximum word length above which the terms will be ignored. Defaults
	// to unbounded (0).
	MaxWordLength interface{}
	// An array of stop words. Any word in this set is considered
	// "uninteresting" and ignored. If the analyzer allows for stop words, you
	// might want to tell MLT to explicitly ignore them, as for the purposes of
	// document similarity it seems reasonable to assume that "a stop word is
	// never interesting".
	StopWords []string
	// The analyzer that is used to analyze the free form text. Defaults to the
	// analyzer associated with the first field in fields.
	Analyzer string

	// After the disjunctive query has been formed, this parameter controls the
	// number of terms that must match. The syntax is the same as the minimum
	// should match. (Defaults to "30%").
	MinimumShouldMatch string
	// Controls whether the query should fail (throw an exception) if any of the
	// specified fields are not of the supported types (text or keyword). Set
	// this to false to ignore the field and continue processing. Defaults to
	// true.
	FailOnUnsupportedField interface{}
	// Each term in the formed query could be further boosted by their tf-idf
	// score. This sets the boost factor to use when using this feature.
	// Defaults to deactivated (0). Any other positive value activates terms
	// boosting with the given boost factor.
	BoostTerms interface{}
	// Specifies whether the input documents should also be included in the
	// search results returned. Defaults to false.
	Include interface{}
	// Sets the boost value of the whole query. Defaults to 1.0.
	Boost interface{}
	// contains filtered or unexported fields
}

func (MoreLikeThisQueryParams) Clause

func (MoreLikeThisQueryParams) Complete

func (MoreLikeThisQueryParams) Complete()

func (MoreLikeThisQueryParams) Kind

func (MoreLikeThisQueryParams) MoreLikeThis

func (p MoreLikeThisQueryParams) MoreLikeThis() (*MoreLikeThisQuery, error)

type MoreLikeThiser

type MoreLikeThiser interface {
	MoreLikeThis() (*MoreLikeThisQuery, error)
}

type MultiMatchQuery

type MultiMatchQuery struct {
	// contains filtered or unexported fields
}

func (MultiMatchQuery) Analyzer

func (ap MultiMatchQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (MultiMatchQuery) AutoGenerateSynonymsPhraseQuery

func (a MultiMatchQuery) AutoGenerateSynonymsPhraseQuery() bool

AutoGenerateSynonymsPhraseQuery determines if match phrase queries are automatically created for multi-term synonyms. Defaults to true.

func (MultiMatchQuery) Boost

func (b MultiMatchQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*MultiMatchQuery) Clause

func (q *MultiMatchQuery) Clause() (QueryClause, error)

func (*MultiMatchQuery) Clear

func (q *MultiMatchQuery) Clear()

func (MultiMatchQuery) Complete

func (MultiMatchQuery) Complete()

func (MultiMatchQuery) CutoffFrequency

func (cf MultiMatchQuery) CutoffFrequency() dynamic.Number

func (MultiMatchQuery) DefaultFuzzyRewrite

func (f MultiMatchQuery) DefaultFuzzyRewrite() Rewrite

func (MultiMatchQuery) Fields

func (q MultiMatchQuery) Fields() []string

func (MultiMatchQuery) Fuzziness

func (f MultiMatchQuery) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (MultiMatchQuery) FuzzyRewrite

func (f MultiMatchQuery) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (MultiMatchQuery) FuzzyTranspositions

func (ft MultiMatchQuery) FuzzyTranspositions() bool

FuzzyTranspositions edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

func (*MultiMatchQuery) IsEmpty

func (q *MultiMatchQuery) IsEmpty() bool

func (MultiMatchQuery) Kind

func (MultiMatchQuery) Kind() QueryKind

func (MultiMatchQuery) Lenient

func (l MultiMatchQuery) Lenient() bool

Lenient determines whether format-based errors, such as providing a text query value for a numeric field, are ignored. Defaults to false.

func (MultiMatchQuery) MarshalBSON

func (q MultiMatchQuery) MarshalBSON() ([]byte, error)

func (MultiMatchQuery) MarshalJSON

func (q MultiMatchQuery) MarshalJSON() ([]byte, error)

func (MultiMatchQuery) MaxExpansions

func (me MultiMatchQuery) MaxExpansions() int

MaxExpansions is the maximum number of variations created. Defaults to 50.

func (MultiMatchQuery) MinimumShouldMatch

func (msm MultiMatchQuery) MinimumShouldMatch() string

func (*MultiMatchQuery) MultiMatch

func (q *MultiMatchQuery) MultiMatch() (*MultiMatchQuery, error)

func (MultiMatchQuery) Name

func (n MultiMatchQuery) Name() string

func (MultiMatchQuery) Operator

func (o MultiMatchQuery) Operator() Operator

Operator is the boolean logic used to interpret text in the query value. Defaults to Or

func (MultiMatchQuery) PrefixLength

func (pl MultiMatchQuery) PrefixLength() int

func (MultiMatchQuery) Query

func (q MultiMatchQuery) Query() string

func (*MultiMatchQuery) SetAnalyzer

func (ap *MultiMatchQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*MultiMatchQuery) SetAutoGenerateSynonymsPhraseQuery

func (a *MultiMatchQuery) SetAutoGenerateSynonymsPhraseQuery(v interface{}) error

SetAutoGenerateSynonymsPhraseQuery sets AutoGenerateSynonymsPhraseQueryValue to v

func (*MultiMatchQuery) SetBoost

func (b *MultiMatchQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*MultiMatchQuery) SetCutoffFreuency

func (cf *MultiMatchQuery) SetCutoffFreuency(n dynamic.Number)

func (*MultiMatchQuery) SetFields

func (q *MultiMatchQuery) SetFields(fields []string) error

func (*MultiMatchQuery) SetFuzziness

func (f *MultiMatchQuery) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*MultiMatchQuery) SetFuzzyRewrite

func (f *MultiMatchQuery) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*MultiMatchQuery) SetFuzzyTranspositions

func (ft *MultiMatchQuery) SetFuzzyTranspositions(fuzzyTranspositions interface{}) error

SetFuzzyTranspositions sets FuzzyTranspositions to v

func (*MultiMatchQuery) SetLenient

func (l *MultiMatchQuery) SetLenient(v bool)

SetLenient sets Lenient to v

func (*MultiMatchQuery) SetMaxExpansions

func (me *MultiMatchQuery) SetMaxExpansions(v interface{}) error

func (*MultiMatchQuery) SetMinimumShouldMatch

func (msm *MultiMatchQuery) SetMinimumShouldMatch(v string)

func (*MultiMatchQuery) SetName

func (n *MultiMatchQuery) SetName(name string)

func (*MultiMatchQuery) SetOperator

func (o *MultiMatchQuery) SetOperator(v Operator) error

SetOperator sets the Operator to v

func (*MultiMatchQuery) SetPrefixLength

func (pl *MultiMatchQuery) SetPrefixLength(v interface{}) error

func (*MultiMatchQuery) SetQuery

func (q *MultiMatchQuery) SetQuery(query string) error

func (*MultiMatchQuery) SetTieBreaker

func (tb *MultiMatchQuery) SetTieBreaker(tieBreaker interface{}) error

func (*MultiMatchQuery) SetType

func (mm *MultiMatchQuery) SetType(typ MultiMatchType) error

SetType sets type to typ https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#multi-match-types

func (*MultiMatchQuery) SetZeroTermsQuery

func (ztq *MultiMatchQuery) SetZeroTermsQuery(v ZeroTerms) error

func (*MultiMatchQuery) UnmarshalBSON

func (q *MultiMatchQuery) UnmarshalBSON(data []byte) error

func (*MultiMatchQuery) UnmarshalJSON

func (q *MultiMatchQuery) UnmarshalJSON(data []byte) error

func (MultiMatchQuery) ZeroTermsQuery

func (ztq MultiMatchQuery) ZeroTermsQuery() ZeroTerms

ZeroTermsQuery indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-zero

type MultiMatchQueryParams

type MultiMatchQueryParams struct {
	// Each query accepts a _name in its top level definition. You can use named
	// queries to track which queries matched returned documents. If named
	// queries are used, the response includes a matched_queries property for
	// each hit.
	Name string
	// The fields which are being matched.
	Fields []string
	// (Required) The query string
	Query string
	// Analyzer used to convert the text in the query value into tokens.
	// Defaults to the index-time analyzer mapped for the <field>. If no
	// analyzer is mapped, the index’s default analyzer is used.
	Analyzer string
	// If true, match phrase queries are NOT automatically created for
	// multi-term synonyms.
	//
	// If true, auto_generate_synonyms_phrase_query is set to false
	AutoGenerateSynonymsPhraseQuery interface{}
	// If true, edits for fuzzy matching DO NOT include transpositions of two
	// adjacent characters (ab → ba).
	FuzzyTranspositions interface{}
	// Maximum edit distance allowed for matching.
	Fuzziness    string
	FuzzyRewrite Rewrite
	//  If true, format-based errors, such as providing a text query value for a
	//  numeric field, are ignored. Defaults to false.
	Lenient bool
	// Boolean logic used to interpret text in the query value. Defaults to OR
	Operator Operator
	// Maximum number of terms to which the query will expand. Defaults to 50.
	MaxExpansions interface{}
	// Number of beginning characters left unchanged for fuzzy matching.
	// Defaults to 0.
	PrefixLength interface{}
	// Minimum number of clauses that must match for a document to be returned
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html
	MinimumShouldMatchParam string
	// Indicates whether no documents are returned if the analyzer removes all
	// tokens, such as when using a stop filter.
	ZeroTermsQuery ZeroTerms

	// The match query supports a cutoff_frequency that allows specifying an
	// absolute or relative document frequency where high frequency terms are
	// moved into an optional subquery and are only scored if one of the low
	// frequency (below the cutoff) terms in the case of an or operator or all
	// of the low frequency terms in the case of an and operator match.
	//
	// DEPRECATED in 7.3.0
	//
	// This option can be omitted as the Match can skip blocks of documents
	// efficiently, without any configuration, provided that the total number of
	// hits is not tracked.
	CutoffFrequency interface{}
	// contains filtered or unexported fields
}

func (MultiMatchQueryParams) Clause

func (p MultiMatchQueryParams) Clause() (QueryClause, error)

func (MultiMatchQueryParams) Complete

func (MultiMatchQueryParams) Complete()

func (MultiMatchQueryParams) Kind

func (MultiMatchQueryParams) MultiMatch

func (p MultiMatchQueryParams) MultiMatch() (*MultiMatchQuery, error)

type MultiMatchType

type MultiMatchType string

https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#multi-match-types

const (
	MultiMatchTypeUnspecified MultiMatchType = ""
	// (default) Finds documents which match any field, but uses the _score from
	// the best field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-best-fields
	MultiMatchBestFields MultiMatchType = "best_fields"
	// Finds documents which match any field and combines the _score from each
	// field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-most-fields
	MultiMatchMostFields MultiMatchType = "most_fields"
	// Treats fields with the same analyzer as though they were one big field.
	// Looks for each word in any field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-cross-fields
	MultiMatchCrossFields MultiMatchType = "cross_fields"
	// Runs a match_phrase query on each field and uses the _score from the best
	// field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-phrase
	MultiMatchPhrase MultiMatchType = "phrase"
	// Runs a match_phrase_prefix query on each field and uses the _score from
	// the best field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-phrase
	MultiMatchPhrasePrefix MultiMatchType = "phrase_prefix"
	// Creates a match_bool_prefix query on each field and combines the _score
	// from each field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#type-bool-prefix
	MultiMatchBoolPrefix MultiMatchType = "bool_prefix"
)

func (*MultiMatchType) IsValid

func (mm *MultiMatchType) IsValid() bool

func (MultiMatchType) String

func (mm MultiMatchType) String() string

func (MultiMatchType) Validate

func (mm MultiMatchType) Validate() error

type MultiMatcher

type MultiMatcher interface {
	MultiMatch() (*MultiMatchQuery, error)
}

type NestedField

type NestedField struct {
	// contains filtered or unexported fields
}

NestedField is a specialised version of the object data type that allows arrays of objects to be indexed in a way that they can be queried independently of each other.

When ingesting key-value pairs with a large, arbitrary set of keys, you might consider modeling each key-value pair as its own nested document with key and value fields. Instead, consider using the flattened data type, which maps an entire object as a single field and allows for simple searches over its contents. Nested documents and queries are typically expensive, so using the flattened data type for this use case is a better option.

Interacting with nested documents

Nested documents can be:

- queried with the nested query.

- analyzed with the nested and reverse_nested aggregations.

- sorted with nested sorting.

- retrieved and highlighted with nested inner hits.

IMPORTANT

Because nested documents are indexed as separate documents, they can only be accessed within the scope of the nested query, the nested/reverse_nested aggregations, or nested inner hits.

For instance, if a string field within a nested document has index_options set to offsets to allow use of the postings during the highlighting, these offsets will not be available during the main highlighting phase. Instead, highlighting needs to be performed via nested inner hits. The same consideration applies when loading fields during a search through docvalue_fields or stored_fields.

Limits on nested mappings and objects

As described earlier, each nested object is indexed as a separate Lucene document. Continuing with the previous example, if we indexed a single document containing 100 user objects, then 101 Lucene documents would be created: one for the parent document, and one for each nested object. Because of the expense associated with nested mappings, Elasticsearch puts settings in place to guard against performance problems:

index.mapping.nested_fields.limit

The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when arrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this setting limits the number of unique nested types per index. Default is 50.

index.mapping.nested_objects.limit

The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. Default is 10000.

To illustrate how this setting works, consider adding another nested type called comments to the previous example mapping. For each document, the combined number of user and comment objects it contains must be below the limit.

See Settings to prevent mapping explosion regarding additional settings for preventing mappings explosion. https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html

func NewNestedField

func NewNestedField(params NestedFieldParams) (*NestedField, error)

func (NestedField) Dynamic

func (dp NestedField) Dynamic() Dynamic

Dynamic determines whether or not new properties should be added dynamically to an existing object. Accepts true (default), false and strict.

func (*NestedField) Field

func (n *NestedField) Field() (Field, error)

func (NestedField) IncludeInParent

func (iip NestedField) IncludeInParent() bool

IncludeInParent (Optional, Boolean) If true, all fields in the nested object are also added to the parent document as standard (flat) fields. Defaults to false.

func (NestedField) IncludeInRoot

func (iir NestedField) IncludeInRoot() bool

IncludeInRoot deteremines if all fields in the nested object are also added to the root document as standard (flat) fields. Defaults to false

func (NestedField) MarshalBSON

func (n NestedField) MarshalBSON() ([]byte, error)

func (NestedField) MarshalJSON

func (n NestedField) MarshalJSON() ([]byte, error)

func (NestedField) Properties

func (p NestedField) Properties() Fields

Properties are fields within the object, which can be of any data type, including object. New properties may be added to an existing object.

func (*NestedField) SetDynamic

func (dp *NestedField) SetDynamic(dynamic Dynamic) error

SetDynamic sets the value of Dynamic to v.

func (*NestedField) SetIncludeInParent

func (iip *NestedField) SetIncludeInParent(v interface{}) error

SetIncludeInParent sets the IncludeInParent Value to v

func (*NestedField) SetIncludeInRoot

func (iir *NestedField) SetIncludeInRoot(v interface{}) error

SetIncludeInRoot sets the IncludeInRoot Value to v

func (*NestedField) SetProperties

func (p *NestedField) SetProperties(v Fieldset) error

SetProperties sets the Properties value to v

func (NestedField) Type

func (NestedField) Type() FieldType

func (*NestedField) UnmarshalBSON

func (n *NestedField) UnmarshalBSON(data []byte) error

func (*NestedField) UnmarshalJSON

func (n *NestedField) UnmarshalJSON(data []byte) error

type NestedFieldParams

type NestedFieldParams struct {
	// (Optional) Whether or not new properties should be added dynamically to an existing nested object. Accepts true (default), false and strict.
	Dynamic Dynamic `json:"dynamic,omitempty"`
	// (Optional) The fields within the nested object, which can be of
	// any data type, including nested. New properties may be added to an
	// existing nested object.
	Properties Fieldset `json:"properties,omitempty"`
	// (Optional, Boolean) If true, all fields in the nested object are also
	// added to the parent document as standard (flat) fields. Defaults to
	// false.
	IncludeInParent interface{} `json:"include_in_parent,omitempty"`
	// (Optional, Boolean) If true, all fields in the nested object are also
	// added to the root document as standard (flat) fields. Defaults to false.
	IncludeInRoot interface{} `json:"include_in_root,omitempty"`
}

func (NestedFieldParams) Field

func (p NestedFieldParams) Field() (Field, error)

func (NestedFieldParams) Nested

func (p NestedFieldParams) Nested() (*NestedField, error)

func (NestedFieldParams) Type

type NestedQuerier

type NestedQuerier interface {
	Nested() (*NestedQuery, error)
}

type NestedQuery

type NestedQuery struct {
	// contains filtered or unexported fields
}

func (*NestedQuery) Clause

func (q *NestedQuery) Clause() (QueryClause, error)

func (*NestedQuery) Clear

func (q *NestedQuery) Clear()

func (NestedQuery) Complete

func (NestedQuery) Complete()

func (NestedQuery) IgnoreUnmapped

func (q NestedQuery) IgnoreUnmapped() bool

func (*NestedQuery) IsEmpty

func (q *NestedQuery) IsEmpty() bool

func (NestedQuery) Kind

func (NestedQuery) Kind() QueryKind

func (NestedQuery) MarshalBSON

func (q NestedQuery) MarshalBSON() ([]byte, error)

func (NestedQuery) MarshalJSON

func (q NestedQuery) MarshalJSON() ([]byte, error)

func (NestedQuery) Name

func (n NestedQuery) Name() string

func (*NestedQuery) Nested

func (q *NestedQuery) Nested() (*NestedQuery, error)

func (NestedQuery) Path

func (q NestedQuery) Path() string

func (NestedQuery) Query

func (q NestedQuery) Query(query Querier) *Query

func (*NestedQuery) ScoreMode

func (sm *NestedQuery) ScoreMode() ScoreMode

func (*NestedQuery) SetIgnoreUnmapped

func (q *NestedQuery) SetIgnoreUnmapped(v interface{}) error

func (*NestedQuery) SetName

func (n *NestedQuery) SetName(name string)

func (*NestedQuery) SetPath

func (q *NestedQuery) SetPath(v string) error

func (*NestedQuery) SetQuery

func (q *NestedQuery) SetQuery(query Querier) error

func (*NestedQuery) SetScoreMode

func (sm *NestedQuery) SetScoreMode(scoreMode ScoreMode) error

func (*NestedQuery) UnmarshalBSON

func (q *NestedQuery) UnmarshalBSON(data []byte) error

func (*NestedQuery) UnmarshalJSON

func (q *NestedQuery) UnmarshalJSON(data []byte) error

type NestedQueryParams

type NestedQueryParams struct {
	Name           string
	Query          Querier
	Path           string
	ScoreMode      ScoreMode
	IgnoreUnmapped interface{}
	// contains filtered or unexported fields
}

func (NestedQueryParams) Clause

func (p NestedQueryParams) Clause() (QueryClause, error)

func (NestedQueryParams) Complete

func (NestedQueryParams) Complete()

func (NestedQueryParams) Kind

func (NestedQueryParams) Nested

func (p NestedQueryParams) Nested() (*NestedQuery, error)

type ObjectField

type ObjectField struct {
	// contains filtered or unexported fields
}

An ObjectField is a field type that contains other documents

JSON documents are hierarchical in nature: the document may contain inner objects which, in turn, may contain inner objects themselves

https://www.elastic.co/guide/en/elasticsearch/reference/7.12/object.html

func NewObjectField

func NewObjectField(params ObjectFieldParams) (*ObjectField, error)

func (ObjectField) Dynamic

func (dp ObjectField) Dynamic() Dynamic

Dynamic determines whether or not new properties should be added dynamically to an existing object. Accepts true (default), false and strict.

func (ObjectField) Enabled

func (ep ObjectField) Enabled() bool

Enabled determines whether the JSON value given for the object field should be parsed and indexed (true, default) or completely ignored (false).

func (*ObjectField) Field

func (o *ObjectField) Field() (Field, error)

func (ObjectField) MarshalBSON

func (o ObjectField) MarshalBSON() ([]byte, error)

func (ObjectField) MarshalJSON

func (o ObjectField) MarshalJSON() ([]byte, error)

func (ObjectField) Properties

func (p ObjectField) Properties() Fields

Properties are fields within the object, which can be of any data type, including object. New properties may be added to an existing object.

func (*ObjectField) SetDynamic

func (dp *ObjectField) SetDynamic(dynamic Dynamic) error

SetDynamic sets the value of Dynamic to v.

func (*ObjectField) SetEnabled

func (ep *ObjectField) SetEnabled(v interface{}) error

SetEnabled sets Enabled to v

func (*ObjectField) SetProperties

func (p *ObjectField) SetProperties(v Fieldset) error

SetProperties sets the Properties value to v

func (ObjectField) Type

func (ObjectField) Type() FieldType

func (*ObjectField) UnmarshalBSON

func (o *ObjectField) UnmarshalBSON(data []byte) error

func (*ObjectField) UnmarshalJSON

func (o *ObjectField) UnmarshalJSON(data []byte) error

type ObjectFieldParams

type ObjectFieldParams struct {
	Properties FieldMap    `json:"properties,omitempty"`
	Enabled    interface{} `json:"enabled,omitempty"`
	Dynamic    Dynamic     `json:"dynamic,omitempty"`
}

func (ObjectFieldParams) Field

func (p ObjectFieldParams) Field() (Field, error)

func (ObjectFieldParams) Object

func (p ObjectFieldParams) Object() (*ObjectField, error)

func (ObjectFieldParams) Type

type Operator

type Operator string

func (Operator) String

func (o Operator) String() string

type Orientation

type Orientation string
const (
	OrientationUnspecified Orientation = ""
	// OrientationRight - Counter-Clockwise Orientation (RIGHT)
	OrientationRight Orientation = "right"
	// OrientationCounterClockwise - Counter-Cloockwise orientation (RIGHT)
	OrientationCounterClockwise Orientation = "counterclockwise"
	// OrientationCCW - Counter-clockwise orientation (RIGHT)
	OrientationCCW Orientation = "ccw"
	// OrientationLeft - Clockwise Orientation
	OrientationLeft Orientation = "left"
	// OrientationClockwise - Clockwise Oreintation (LEFT)
	OrientationClockwise Orientation = "clockwise"
	// OrientationCW Clockwise Orientation (LEFT)
	OrientationCW Orientation = "cw"
)

func (Orientation) IsClockwise

func (o Orientation) IsClockwise() bool

IsClockwise indicates whether the Orientation is Clockwise

func (Orientation) IsCounterClockwise

func (o Orientation) IsCounterClockwise() bool

IsCounterClockwise indicates whether the Orientation is Counter-Clockwise

func (*Orientation) IsValid

func (o *Orientation) IsValid() bool

func (Orientation) String

func (o Orientation) String() string

func (*Orientation) Validate

func (o *Orientation) Validate() error

type ParentIDQuery

type ParentIDQuery struct {
	// contains filtered or unexported fields
}

func (*ParentIDQuery) Clause

func (q *ParentIDQuery) Clause() (QueryClause, error)

func (*ParentIDQuery) Clear

func (q *ParentIDQuery) Clear()

func (ParentIDQuery) Complete

func (ParentIDQuery) Complete()

func (ParentIDQuery) ID

func (q ParentIDQuery) ID() string

func (ParentIDQuery) IgnoreUnmapped

func (q ParentIDQuery) IgnoreUnmapped() bool

func (*ParentIDQuery) IsEmpty

func (q *ParentIDQuery) IsEmpty() bool

func (ParentIDQuery) Kind

func (ParentIDQuery) Kind() QueryKind

func (ParentIDQuery) MarshalBSON

func (q ParentIDQuery) MarshalBSON() ([]byte, error)

func (ParentIDQuery) MarshalJSON

func (q ParentIDQuery) MarshalJSON() ([]byte, error)

func (ParentIDQuery) Name

func (n ParentIDQuery) Name() string

func (*ParentIDQuery) ParentID

func (q *ParentIDQuery) ParentID() (*ParentIDQuery, error)

func (*ParentIDQuery) SetID

func (q *ParentIDQuery) SetID(id string) error

func (*ParentIDQuery) SetIgnoreUnmapped

func (q *ParentIDQuery) SetIgnoreUnmapped(ignore interface{}) error

func (*ParentIDQuery) SetName

func (n *ParentIDQuery) SetName(name string)

func (*ParentIDQuery) SetType

func (q *ParentIDQuery) SetType(typ string) error

func (ParentIDQuery) Type

func (q ParentIDQuery) Type() string

func (*ParentIDQuery) UnmarshalBSON

func (q *ParentIDQuery) UnmarshalBSON(data []byte) error

func (*ParentIDQuery) UnmarshalJSON

func (q *ParentIDQuery) UnmarshalJSON(data []byte) error

type ParentIDQueryParams

type ParentIDQueryParams struct {
	Name string
	// (Required) ID of the parent document. The query will return child documents of this parent docume
	ID string
	// (Required, string) Name of the child relationship mapped for the join field.
	Type string
	// (Optional, Boolean) Indicates whether to ignore an unmapped type and not
	// return any documents instead of an error. Defaults to false.
	//
	// If false, Elasticsearch returns an error if the type is unmapped.
	//
	// You can use this parameter to query multiple indices that may not contain the
	// type.
	IgnoreUnmapped interface{}
	// contains filtered or unexported fields
}

func (ParentIDQueryParams) Clause

func (p ParentIDQueryParams) Clause() (QueryClause, error)

func (ParentIDQueryParams) Complete

func (ParentIDQueryParams) Complete()

func (ParentIDQueryParams) Kind

func (ParentIDQueryParams) ParentID

func (p ParentIDQueryParams) ParentID() (*ParentIDQuery, error)

type ParentIDer

type ParentIDer interface {
	ParentID() (*ParentIDQuery, error)
}

type PercolateDocumentQueryParams

type PercolateDocumentQueryParams struct {
	// The field of type percolator that holds the indexed queries. This is a
	// required parameter.
	Field string
	// The suffix to be used for the _percolator_document_slot field in case
	// multiple percolate queries have been specified. This is an optional
	// parameter.
	Name     string
	Document interface{}
	// The type / mapping of the document being percolated.
	//
	// Deprecated and will be removed in Elasticsearch 8.0.
	DocumentType string
	// contains filtered or unexported fields
}

func (PercolateDocumentQueryParams) Clause

func (PercolateDocumentQueryParams) Complete

func (PercolateDocumentQueryParams) Complete()

func (PercolateDocumentQueryParams) Kind

func (PercolateDocumentQueryParams) Percolate

type PercolateDocumentsQueryParams

type PercolateDocumentsQueryParams struct {
	// The field of type percolator that holds the indexed queries. This is a
	// required parameter.
	Field string
	// The suffix to be used for the _percolator_document_slot field in case
	// multiple percolate queries have been specified. This is an optional
	// parameter.
	Name string
	// Like the document parameter, but accepts multiple documents via a json
	// array.
	Documents interface{}
	// The type / mapping of the document being percolated.
	//
	// Deprecated and will be removed in Elasticsearch 8.0.
	DocumentType string
	// contains filtered or unexported fields
}

func (PercolateDocumentsQueryParams) Clause

func (PercolateDocumentsQueryParams) Complete

func (PercolateDocumentsQueryParams) Complete()

func (PercolateDocumentsQueryParams) Kind

func (PercolateDocumentsQueryParams) Percolate

type PercolateQuery

type PercolateQuery struct {
	// contains filtered or unexported fields
}

func (*PercolateQuery) Clause

func (q *PercolateQuery) Clause() (QueryClause, error)

func (*PercolateQuery) Clear

func (q *PercolateQuery) Clear()

func (PercolateQuery) Complete

func (PercolateQuery) Complete()

func (PercolateQuery) Document

func (q PercolateQuery) Document() interface{}

func (PercolateQuery) DocumentType

func (q PercolateQuery) DocumentType() string

func (PercolateQuery) Documents

func (q PercolateQuery) Documents() interface{}

func (PercolateQuery) Field

func (f PercolateQuery) Field() string

func (PercolateQuery) ID

func (q PercolateQuery) ID() string

func (PercolateQuery) Index

func (q PercolateQuery) Index() string

func (*PercolateQuery) IsEmpty

func (q *PercolateQuery) IsEmpty() bool

func (PercolateQuery) Kind

func (PercolateQuery) Kind() QueryKind

func (PercolateQuery) MarshalBSON

func (q PercolateQuery) MarshalBSON() ([]byte, error)

func (PercolateQuery) MarshalJSON

func (q PercolateQuery) MarshalJSON() ([]byte, error)

func (PercolateQuery) Name

func (n PercolateQuery) Name() string

func (*PercolateQuery) Percolate

func (q *PercolateQuery) Percolate() (*PercolateQuery, error)

func (PercolateQuery) Preference

func (q PercolateQuery) Preference() string

func (PercolateQuery) Routing

func (q PercolateQuery) Routing() string

func (*PercolateQuery) SetDocument

func (q *PercolateQuery) SetDocument(doc interface{}) error

func (*PercolateQuery) SetDocumentType

func (q *PercolateQuery) SetDocumentType(typ string)

func (*PercolateQuery) SetDocuments

func (q *PercolateQuery) SetDocuments(docs interface{}) error

func (*PercolateQuery) SetField

func (f *PercolateQuery) SetField(field string) error

func (*PercolateQuery) SetID

func (q *PercolateQuery) SetID(id string)

func (*PercolateQuery) SetIndex

func (q *PercolateQuery) SetIndex(index string)

func (*PercolateQuery) SetName

func (n *PercolateQuery) SetName(name string)

func (*PercolateQuery) SetPreference

func (q *PercolateQuery) SetPreference(pref string)

func (*PercolateQuery) SetRouting

func (q *PercolateQuery) SetRouting(routing string)

func (*PercolateQuery) SetType

func (q *PercolateQuery) SetType(typ string)

func (*PercolateQuery) SetVersion

func (q *PercolateQuery) SetVersion(vers int)

func (PercolateQuery) Type

func (q PercolateQuery) Type() string

func (*PercolateQuery) UnmarshalBSON

func (q *PercolateQuery) UnmarshalBSON(data []byte) error

func (*PercolateQuery) UnmarshalJSON

func (q *PercolateQuery) UnmarshalJSON(data []byte) error

func (PercolateQuery) Version

func (q PercolateQuery) Version() int

type PercolateStoredDocumentQuery

type PercolateStoredDocumentQuery struct {
	// The suffix to be used for the _percolator_document_slot field in case
	// multiple percolate queries have been specified. This is an optional
	// parameter.
	Name string
	// The field of type percolator that holds the indexed queries. This is a required parameter.
	Field string
	// The id of the document to fetch. This is a required parameter.
	ID string
	// The index the document resides in. This is a required parameter.
	Index string
	// Optionally, routing to be used to fetch document to percolate.
	Routing string
	// The type of the document to fetch. This parameter is deprecated and will
	// be removed in Elasticsearch 8.0.
	Type string
	// Optionally, preference to be used to fetch document to percolate.
	Preference string
	// Optionally, the expected version of the document to be fetched.
	Version int
	// contains filtered or unexported fields
}

func (PercolateStoredDocumentQuery) Clause

func (PercolateStoredDocumentQuery) Complete

func (PercolateStoredDocumentQuery) Complete()

func (PercolateStoredDocumentQuery) Kind

func (PercolateStoredDocumentQuery) Percolate

type Percolater

type Percolater interface {
	Percolate() (*PercolateQuery, error)
}

type PercolatorField

type PercolatorField struct{}

The PercolatorField type parses a json structure into a native query and stores that query, so that the percolate query can use it to match provided documents.

Any field that contains a json object can be configured to be a percolator field. The percolator field type has no settings. Just configuring the percolator field type is sufficient to instruct Elasticsearch to treat a field as a query.

https://www.elastic.co/guide/en/elasticsearch/reference/current/percolator.html

func NewPercolatorField

func NewPercolatorField() (*PercolatorField, error)

func (*PercolatorField) Field

func (p *PercolatorField) Field() (Field, error)

func (PercolatorField) MarshalJSON

func (PercolatorField) MarshalJSON() ([]byte, error)

func (PercolatorField) Type

func (PercolatorField) Type() FieldType

func (PercolatorField) UnmarshalJSON

func (PercolatorField) UnmarshalJSON(data []byte) error

type PercolatorFieldParams

type PercolatorFieldParams struct{}

func (PercolatorFieldParams) Field

func (p PercolatorFieldParams) Field() (Field, error)

func (PercolatorFieldParams) Percolator

func (PercolatorFieldParams) Percolator() (*PercolatorField, error)

func (PercolatorFieldParams) Type

type PinnedQuery

type PinnedQuery struct {
	// contains filtered or unexported fields
}

func (*PinnedQuery) Clause

func (q *PinnedQuery) Clause() (QueryClause, error)

func (*PinnedQuery) Clear

func (q *PinnedQuery) Clear()

func (PinnedQuery) Complete

func (PinnedQuery) Complete()

func (*PinnedQuery) IsEmpty

func (q *PinnedQuery) IsEmpty() bool

func (PinnedQuery) Kind

func (PinnedQuery) Kind() QueryKind

func (PinnedQuery) MarshalBSON

func (q PinnedQuery) MarshalBSON() ([]byte, error)

func (PinnedQuery) MarshalJSON

func (q PinnedQuery) MarshalJSON() ([]byte, error)

func (PinnedQuery) Name

func (n PinnedQuery) Name() string

func (*PinnedQuery) Pinned

func (q *PinnedQuery) Pinned() (*PinnedQuery, error)

func (*PinnedQuery) SetName

func (n *PinnedQuery) SetName(name string)

func (*PinnedQuery) UnmarshalBSON

func (q *PinnedQuery) UnmarshalBSON(data []byte) error

func (*PinnedQuery) UnmarshalJSON

func (q *PinnedQuery) UnmarshalJSON(data []byte) error

type PinnedQueryParams

type PinnedQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (PinnedQueryParams) Clause

func (p PinnedQueryParams) Clause() (QueryClause, error)

func (PinnedQueryParams) Complete

func (PinnedQueryParams) Complete()

func (PinnedQueryParams) Kind

func (PinnedQueryParams) Pinned

func (p PinnedQueryParams) Pinned() (*PinnedQuery, error)

type PointField

type PointField struct {
	// contains filtered or unexported fields
}

A PointField accepts latitude-longitude pairs, which can be used:

- to find geo-points within a bounding box, within a certain distance of a central point, or within a polygon or within a geo_shape query.

- to aggregate documents geographically or by distance from a central point.

- to integrate distance into a document’s relevance score.

- to sort documents by distance.

Geo-points expressed as an array or string

Please note that string geo-points are ordered as lat,lon, while array geo-points are ordered as the reverse: lon,lat.

Originally, lat,lon was used for both array and string, but the array format was changed early on to conform to the format used by GeoJSON.

A point can be expressed as a geohash. Geohashes are base32 encoded strings of the bits of the latitude and longitude interleaved. Each character in a geohash adds additional 5 bits to the precision. So the longer the hash, the more precise it is. For the indexing purposed geohashs are translated into latitude-longitude pairs. During this process only first 12 characters are used, so specifying more than 12 characters in a geohash doesn’t increase the precision. The 12 characters provide 60 bits, which should reduce a possible error to less than 2cm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html

func NewPointField

func NewPointField(params PointFieldParams) (*PointField, error)

func (*PointField) Field

func (gp *PointField) Field() (Field, error)

func (PointField) IgnoreMalformed

func (im PointField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (PointField) IgnoreZValue

func (z PointField) IgnoreZValue() bool

IgnoreZValue determines whether three dimension points will be indexed.

If true (default) three dimension points will be accepted (stored in source) but only latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points containing any more than latitude and longitude (two dimensions) values throw an exception and reject the whole document.

func (PointField) MarshalJSON

func (gp PointField) MarshalJSON() ([]byte, error)

func (PointField) NullValue

func (nv PointField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*PointField) SetIgnoreMalformed

func (im *PointField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*PointField) SetIgnoreZValue

func (z *PointField) SetIgnoreZValue(v interface{}) error

SetIgnoreZValue sets the IgnoreZValue Value to v

func (*PointField) SetNullValue

func (nv *PointField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (PointField) Type

func (PointField) Type() FieldType

func (*PointField) UnmarshalJSON

func (gp *PointField) UnmarshalJSON(data []byte) error

type PointFieldParams

type PointFieldParams struct {

	// If true, malformed points are ignored. If false (default), malformed
	// points throw an exception and reject the whole document.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// If true (default) three dimension points will be accepted (stored in
	// source) but only x and y values will be indexed; the third dimension is
	// ignored. If false, points containing any more than x and y (two
	// dimensions) values throw an exception and reject the whole document.
	IgnoreZValue interface{} `json:"ignore_z_value,omitempty"`
	// Accepts an point value which is substituted for any explicit null values.
	// Defaults to null, which means the field is treated as missing.
	NullValue interface{} `json:"null_value,omitempty"`
}

func (PointFieldParams) Field

func (p PointFieldParams) Field() (Field, error)

func (PointFieldParams) Point

func (p PointFieldParams) Point() (*PointField, error)

func (PointFieldParams) Type

func (PointFieldParams) Type() FieldType

type PointInTime

type PointInTime struct {
	ID        string     `bson:"id" json:"id"`
	KeepAlive *time.Time `bson:"keep_alive,omitempty" json:"keep_alive,omitempty"`
}

PointInTime is a lightweight view into the state of the data as it existed when initiated.

! X-Pack

A search request by default executes against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between search_after requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time.

Prerequisites

- If the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or index alias.

- To search a point in time (PIT) for an index alias, you must have the read index privilege for the alias’s concrete indices.

https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html

func (*PointInTime) Clone

func (pit *PointInTime) Clone() *PointInTime

func (*PointInTime) Encode

func (pit *PointInTime) Encode() (*bytes.Buffer, error)

func (PointInTime) MarshalEasyJSON

func (v PointInTime) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PointInTime) MarshalJSON

func (v PointInTime) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PointInTime) UnmarshalEasyJSON

func (v *PointInTime) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PointInTime) UnmarshalJSON

func (v *PointInTime) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type PrefixQuery

type PrefixQuery struct {
	// contains filtered or unexported fields
}

PrefixQuery returns documents that contain a specific prefix in a provided field.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html

func (PrefixQuery) CaseInsensitive

func (ci PrefixQuery) CaseInsensitive() bool

func (*PrefixQuery) Clause

func (p *PrefixQuery) Clause() (QueryClause, error)

func (*PrefixQuery) Clear

func (p *PrefixQuery) Clear()

func (PrefixQuery) Complete

func (PrefixQuery) Complete()

func (*PrefixQuery) IsEmpty

func (p *PrefixQuery) IsEmpty() bool

func (PrefixQuery) Kind

func (p PrefixQuery) Kind() QueryKind

func (PrefixQuery) MarshalBSON

func (p PrefixQuery) MarshalBSON() ([]byte, error)

func (PrefixQuery) MarshalJSON

func (p PrefixQuery) MarshalJSON() ([]byte, error)

func (PrefixQuery) Name

func (n PrefixQuery) Name() string

func (PrefixQuery) Rewrite

func (r PrefixQuery) Rewrite() Rewrite

func (*PrefixQuery) Set

func (p *PrefixQuery) Set(field string, prefixer Prefixer) error

Set sets the value of PrefixQuery.

Valid values:

  • picker.Prefix
  • picker.String
  • nil (clears PrefixQuery)

func (*PrefixQuery) SetCaseInsensitive

func (ci *PrefixQuery) SetCaseInsensitive(v bool)

func (*PrefixQuery) SetName

func (n *PrefixQuery) SetName(name string)

func (*PrefixQuery) SetRewrite

func (r *PrefixQuery) SetRewrite(v Rewrite) error

func (*PrefixQuery) UnmarshalBSON

func (p *PrefixQuery) UnmarshalBSON(data []byte) error

func (*PrefixQuery) UnmarshalJSON

func (p *PrefixQuery) UnmarshalJSON(data []byte) error

func (PrefixQuery) Value

func (p PrefixQuery) Value() string

type PrefixQueryParams

type PrefixQueryParams struct {
	// Field which the query is being performed. This is not needed if setting explicitly
	// but is required if the query is being added to a compound query.
	Field string
	// Beginning characters of terms you wish to find in the provided <field>. (Required)
	Value string
	// Method used to rewrite the query. For valid values and more information,
	// see the rewrite parameter. (Optional)
	Rewrite Rewrite
	// Allows ASCII case insensitive matching of the value with the indexed
	// field values when set to true. Default is false which means the case
	// sensitivity of matching depends on the underlying field’s mapping. (Optional)
	CaseInsensitive bool
	// Name of the query (Optional)
	Name string
	// contains filtered or unexported fields
}

PrefixQueryParams returns documents that contain a specific prefix in a provided field.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html

func (PrefixQueryParams) Clause

func (p PrefixQueryParams) Clause() (QueryClause, error)

func (PrefixQueryParams) Complete

func (PrefixQueryParams) Complete()

func (PrefixQueryParams) Kind

func (p PrefixQueryParams) Kind() QueryKind

func (PrefixQueryParams) Prefix

func (p PrefixQueryParams) Prefix() (*PrefixQuery, error)

type PrefixRule

type PrefixRule struct {
	// contains filtered or unexported fields
}

func (PrefixRule) Analyzer

func (ap PrefixRule) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (PrefixRule) Filter

func (r PrefixRule) Filter() *RuleFilter

func (PrefixRule) MarshalBSON

func (p PrefixRule) MarshalBSON() ([]byte, error)

func (PrefixRule) MarshalJSON

func (p PrefixRule) MarshalJSON() ([]byte, error)

func (PrefixRule) Prefix

func (p PrefixRule) Prefix() string

func (*PrefixRule) Rule

func (p *PrefixRule) Rule() (QueryRule, error)

func (*PrefixRule) SetAnalyzer

func (ap *PrefixRule) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*PrefixRule) SetFilter

func (r *PrefixRule) SetFilter(filter RuleFilterer) error

func (*PrefixRule) SetPrefix

func (p *PrefixRule) SetPrefix(prefix string) error

func (*PrefixRule) SetUseField

func (uf *PrefixRule) SetUseField(field string)

func (PrefixRule) Type

func (PrefixRule) Type() RuleType

func (*PrefixRule) UnmarshalBSON

func (p *PrefixRule) UnmarshalBSON(data []byte) error

func (*PrefixRule) UnmarshalJSON

func (p *PrefixRule) UnmarshalJSON(data []byte) error

func (PrefixRule) UseField

func (uf PrefixRule) UseField() string

type PrefixRuleParams

type PrefixRuleParams struct {
	// (Required) Beginning characters of terms you wish to find in the
	// top-level <field>.
	Prefix string `json:"prefix"`
	// (Optional, string) analyzer used to analyze terms in the query. Defaults
	// to the top-level <field>'s analyzer.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional) An optional interval filter.
	Filter RuleFilterer `json:"filter,omitempty"`
	// (Optional) If specified, then match intervals from this field
	// rather than the top-level <field>.
	//
	// The prefix is normalized using the search analyzer from this field,
	// unless a separate analyzer is specified.
	UseField string `json:"use_field,omitempty"`
}

func (PrefixRuleParams) PrefixRule

func (p PrefixRuleParams) PrefixRule() (*PrefixRule, error)

func (PrefixRuleParams) Rule

func (p PrefixRuleParams) Rule() (Rule, error)

func (PrefixRuleParams) Type

func (PrefixRuleParams) Type() RuleType

type Prefixer

type Prefixer interface {
	Prefix() (*PrefixQuery, error)
}

type Processor

type Processor interface {
	Kind() ProcessorKind
}

Processor is a standin until I can get around to writing out all the various processors

type ProcessorKind

type ProcessorKind string
const (
	ProcessorKindAppend           ProcessorKind = "append"
	ProcessorKindBytes            ProcessorKind = "bytes"
	ProcessorKindCircle           ProcessorKind = "cirlce"
	ProcessorKindCommunityID      ProcessorKind = "community_id"
	ProcessorKindConvert          ProcessorKind = "convert"
	ProcessorKindCSV              ProcessorKind = "csv"
	ProcessorKindDate             ProcessorKind = "date"
	ProcessorKindDateIndexName    ProcessorKind = "date_index_name"
	ProcessorKindDissect          ProcessorKind = "dissect"
	ProcessorKindDotExpander      ProcessorKind = "dot_expander"
	ProcessorKindDrop             ProcessorKind = "drop"
	ProcessorKindEnrich           ProcessorKind = "enrich"
	ProcessorKindFail             ProcessorKind = "fail"
	ProcessorKindFingerprint      ProcessorKind = "fingerprint"
	ProcessorKindForeach          ProcessorKind = "foreach"
	ProcessorKindGeoIP            ProcessorKind = "geoip"
	ProcessorKindGrok             ProcessorKind = "grok"
	ProcessorKindGsub             ProcessorKind = "gsub"
	ProcessorKindHTMLStrip        ProcessorKind = "html_strip"
	ProcessorKindInference        ProcessorKind = "inference"
	ProcessorKindJoin             ProcessorKind = "join"
	ProcessorKindJSON             ProcessorKind = "json"
	ProcessorKindKV               ProcessorKind = "kv"
	ProcessorKindLowercase        ProcessorKind = "lowercase"
	ProcessorKindNetworkDirection ProcessorKind = "network_direction"
	ProcessorKindPipeline         ProcessorKind = "pipeline"
	ProcessorKindRemove           ProcessorKind = "remove"
	ProcessorKindRename           ProcessorKind = "rename"
	ProcessorKindScript           ProcessorKind = "script"
	ProcessorKindSet              ProcessorKind = "set"
	ProcessorKindSetSecurityUser  ProcessorKind = "set_security_user"
	ProcessorKindSort             ProcessorKind = "sort"
	ProcessorKindSplit            ProcessorKind = "split"
	ProcessorKindTrim             ProcessorKind = "trim"
	ProcessorKindUppercase        ProcessorKind = "uppercase"
	ProcessorKindURLDecode        ProcessorKind = "urldecode"
	ProcessorKindURIParts         ProcessorKind = "uri_parts"
	ProcessorKindUserAgent        ProcessorKind = "user_agent"
)

type Processorer

type Processorer interface {
	Processor() (Processor, error)
}

type Processors

type Processors []Processor

func (Processors) UnmarshalJSON

func (ps Processors) UnmarshalJSON([]byte) error

type Querier

type Querier interface {
	Query() (*Query, error)
}

type Queriers

type Queriers []Querier

func (Queriers) Queries

func (r Queriers) Queries() (Queries, error)

type Queries

type Queries []*Query

func (*Queries) Add

func (q *Queries) Add(params Querier) (*Query, error)

func (Queries) IsEmpty

func (q Queries) IsEmpty() bool

func (Queries) Queries

func (q Queries) Queries() (Queries, error)

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query defines the search definition using the ElasticSearch Query DSL

Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON to define queries. Think of the Query DSL as an AST (Abstract Syntax Tree) of queries, consisting of two types of clauses:

Leaf query clauses

Leaf query clauses look for a particular value in a particular field, such as the match, term or range queries. These queries can be used by themselves.

Compound query clauses

Compound query clauses wrap other leaf or compound queries and are used to combine multiple queries in a logical fashion (such as the bool or dis_max query), or to alter their behaviour (such as the constant_score query).

Query clauses behave differently depending on whether they are used in query context or filter context.

func NewQuery

func NewQuery(q Querier) (*Query, error)

func (*Query) Bool

func (q *Query) Bool() *BoolQuery

func (*Query) Boosting

func (q *Query) Boosting() *BoostingQuery

func (*Query) Clauses

func (q *Query) Clauses() (Clauses, error)

func (*Query) ConstantScore

func (q *Query) ConstantScore() *ConstantScoreQuery

func (*Query) DisjunctionMax

func (q *Query) DisjunctionMax() *DisjunctionMaxQuery

func (*Query) DistanceFeature

func (q *Query) DistanceFeature() *DistanceFeatureQuery

func (*Query) Exists

func (q *Query) Exists() *ExistsQuery

func (*Query) FunctionScore

func (q *Query) FunctionScore() *FunctionScoreQuery

func (*Query) Fuzzy

func (q *Query) Fuzzy() *FuzzyQuery

func (*Query) GeoBoundingBox

func (q *Query) GeoBoundingBox() *GeoBoundingBoxQuery

func (*Query) GeoDistance

func (q *Query) GeoDistance() *GeoDistanceQuery

func (*Query) GeoShape

func (q *Query) GeoShape() *GeoShapeQuery

func (*Query) HasChild

func (q *Query) HasChild() *HasChildQuery

func (*Query) HasParent

func (q *Query) HasParent() *HasParentQuery

func (*Query) IDs

func (q *Query) IDs() *IDsQuery

func (*Query) Intervals

func (q *Query) Intervals() *IntervalsQuery

func (*Query) IsEmpty

func (q *Query) IsEmpty() bool

func (Query) MarshalBSON

func (q Query) MarshalBSON() ([]byte, error)

func (Query) MarshalJSON

func (q Query) MarshalJSON() ([]byte, error)

func (*Query) Match

func (q *Query) Match() *MatchQuery

func (*Query) MatchAll

func (q *Query) MatchAll() *MatchAllQuery

func (*Query) MatchBoolPrefix

func (q *Query) MatchBoolPrefix() *MatchBoolPrefixQuery

func (*Query) MatchNone

func (q *Query) MatchNone() *MatchNoneQuery

func (*Query) MatchPhrase

func (q *Query) MatchPhrase() *MatchPhraseQuery

func (*Query) MatchPhrasePrefix

func (q *Query) MatchPhrasePrefix() *MatchPhrasePrefixQuery

func (*Query) MoreLikeThis

func (q *Query) MoreLikeThis() *MoreLikeThisQuery

func (*Query) MultiMatch

func (q *Query) MultiMatch() *MultiMatchQuery

func (*Query) Nested

func (q *Query) Nested() *NestedQuery

func (*Query) ParentID

func (q *Query) ParentID() *ParentIDQuery

func (*Query) Percolate

func (q *Query) Percolate() *PercolateQuery

func (*Query) Prefix

func (q *Query) Prefix() *PrefixQuery

func (*Query) Query

func (q *Query) Query() (*Query, error)

func (*Query) QueryString

func (q *Query) QueryString() *QueryStringQuery

func (*Query) Range

func (q *Query) Range() *RangeQuery

func (*Query) RankFeature

func (q *Query) RankFeature() *RankFeatureQuery

func (*Query) Script

func (q *Query) Script() *ScriptQuery

func (*Query) ScriptScore

func (q *Query) ScriptScore() *ScriptScoreQuery

func (*Query) Set

func (q *Query) Set(params Querier) error

func (*Query) Shape

func (q *Query) Shape() *ShapeQuery

func (*Query) SimpleQueryString

func (q *Query) SimpleQueryString() *SimpleQueryStringQuery

func (*Query) Term

func (q *Query) Term() *TermQuery

func (*Query) Terms

func (q *Query) Terms() *TermsQuery

func (*Query) TermsSet

func (q *Query) TermsSet() *TermsSetQuery

func (*Query) UnmarshalBSON

func (q *Query) UnmarshalBSON(data []byte) error

func (*Query) UnmarshalJSON

func (q *Query) UnmarshalJSON(data []byte) error

func (*Query) Wildcard

func (q *Query) Wildcard() *WildcardQuery

type QueryClause

type QueryClause interface {
	Name() string
	Clear()
	IsEmpty() bool
	CompleteClauser
	json.Marshaler
	json.Unmarshaler
}

type QueryClauses

type QueryClauses struct {
	// contains filtered or unexported fields
}

func (*QueryClauses) Add

func (qc *QueryClauses) Add(clause CompleteClauser, clauses ...CompleteClauser) error

func (*QueryClauses) AddMany

func (qc *QueryClauses) AddMany(clauses Clauses) error

func (*QueryClauses) Clauses

func (qc *QueryClauses) Clauses() []QueryClause

func (QueryClauses) ForEach

func (qc QueryClauses) ForEach(fn func(query QueryClause) error) error

ForEach calls fn for each QueryClause in the QueryClauses set or until an error is returned. If the error is dynamic.Done or an error which returns "done" from Error(), iteration is haulted and nil is returned.

func (QueryClauses) IsEmpty

func (qc QueryClauses) IsEmpty() bool

func (QueryClauses) Len

func (qc QueryClauses) Len() int

func (QueryClauses) MarshalJSON

func (qc QueryClauses) MarshalJSON() ([]byte, error)

func (*QueryClauses) RemoveAllForField

func (qc *QueryClauses) RemoveAllForField(field string) []QueryClause

func (*QueryClauses) RemoveAllOfKind

func (qc *QueryClauses) RemoveAllOfKind(kind QueryKind) []QueryClause

func (*QueryClauses) RemoveAllWithName

func (qc *QueryClauses) RemoveAllWithName(name string) []QueryClause

func (*QueryClauses) Set

func (qc *QueryClauses) Set(clauses Clauses) error

func (*QueryClauses) UnmarshalJSON

func (qc *QueryClauses) UnmarshalJSON(data []byte) error

type QueryError

type QueryError struct {
	Field string
	Err   error
	Kind  QueryKind
}

func (QueryError) Error

func (s QueryError) Error() string

func (QueryError) Unwrap

func (s QueryError) Unwrap() error

type QueryKind

type QueryKind string
const (
	QueryKindPrefix            QueryKind = "prefix"
	QueryKindMatch             QueryKind = "match"
	QueryKindMatchAll          QueryKind = "match_all"
	QueryKindMatchNone         QueryKind = "match_none"
	QueryKindTerm              QueryKind = "term"
	QueryKindExists            QueryKind = "exists"
	QueryKindTerms             QueryKind = "terms"
	QueryKindRange             QueryKind = "range"
	QueryKindBoosting          QueryKind = "boosting"
	QueryKindBoolean           QueryKind = "bool"
	QueryKindConstantScore     QueryKind = "constant_score"
	QueryKindFunctionScore     QueryKind = "function_score"
	QueryKindDisjunctionMax    QueryKind = "dis_max"
	QueryKindAllOf             QueryKind = "all_of"
	QueryKindFuzzy             QueryKind = "fuzzy"
	QueryKindScriptScore       QueryKind = "script_score"
	QueryKindScript            QueryKind = "script"
	QueryKindIDs               QueryKind = "ids"
	QueryKindIntervals         QueryKind = "intervals"
	QueryKindMatchBoolPrefix   QueryKind = "match_bool_prefix"
	QueryKindMatchPhrase       QueryKind = "match_phrase"
	QueryKindMatchPhrasePrefix QueryKind = "match_phrase_prefix"
	QueryKindMultiMatch        QueryKind = "multi_match"
	QueryKindQueryString       QueryKind = "query_string"
	QueryKindSimpleQueryString QueryKind = "simple_query_string"
	QueryKindGeoBoundingBox    QueryKind = "geo_bounding_box"
	QueryKindGeoDistance       QueryKind = "geo_distance"
	QueryKindGeoPolygon        QueryKind = "geo_polygon"
	QueryKindGeoShape          QueryKind = "geo_shape"
	QueryKindShape             QueryKind = "shape"
	QueryKindNested            QueryKind = "nested"
	QueryKindHasChild          QueryKind = "has_child"
	QueryKindHasParent         QueryKind = "has_parent"
	QueryKindParentID          QueryKind = "parent_id"
	QueryKindDistanceFeature   QueryKind = "distance_feature"
	QueryKindMoreLikeThis      QueryKind = "more_like_this"
	QueryKindPercolate         QueryKind = "percolate"
	QueryKindRankFeature       QueryKind = "rank_feature"
	QueryKindWrapper           QueryKind = "wrapper"
	QueryKindPinned            QueryKind = "pinned"
	QueryKindSpanContaining    QueryKind = "span_containing"
	QueryKindFieldMaskingSpan  QueryKind = "field_masking_span"
	QueryKindSpanFirst         QueryKind = "span_first"
	QueryKindSpanMulti         QueryKind = "span_multi"
	QueryKindSpanNear          QueryKind = "span_near"
	QueryKindSpanNot           QueryKind = "span_not"
	QueryKindSpanOr            QueryKind = "span_or"
	QueryKindSpanTerm          QueryKind = "span_term"
	QueryKindSpanWithin        QueryKind = "span_within"
	QueryKindCommon            QueryKind = "common"
	QueryKindRegexp            QueryKind = "regexp"
	QueryKindTermsSet          QueryKind = "terms_set"
	QueryKindType              QueryKind = "type"
	QueryKindWildcard          QueryKind = "wildcard"
)

func (QueryKind) IsValid

func (t QueryKind) IsValid() bool

func (QueryKind) String

func (t QueryKind) String() string

type QueryParams

type QueryParams struct {

	// Term returns documents that contain an exact term in a provided field.
	//
	// You can use the term query to find documents based on a precise value
	// such as a price, a product ID, or a username.
	//
	// Avoid using the term query for text fields.
	//
	// By default, Elasticsearch changes the values of text fields as part of
	// analysis. This can make finding exact matches for text field values
	// difficult.
	//
	// To search text field values, use the match query instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
	Term CompleteTermer

	// Terms returns documents that contain one or more exact terms in a provided
	// field.
	//
	// The terms query is the same as the term query, except you can search for
	// multiple values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-terms-query.html
	Terms CompleteTermser

	// Match returns documents that match a provided text, number, date or
	// boolean value. The provided text is analyzed before matching.
	//
	// The match query is the standard query for performing a full-text search,
	// including options for fuzzy matching.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
	Match CompleteMatcher

	// Bool is a query that matches documents matching boolean combinations
	// of other queries. The bool query maps to Lucene BooleanQuery. It is built
	// using one or more boolean clauses, each clause with a typed occurrence.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
	Bool Booler

	// Fuzzy returns documents that contain terms similar to the search term, as
	// measured by a Levenshtein edit distance.
	//
	// An edit distance is the number of one-character changes needed to turn
	// one term into another. These changes can include:
	//
	// - Changing a character (box → fox)
	//
	// - Removing a character (black → lack)
	//
	// - Inserting a character (sic → sick)
	//
	// - Transposing two adjacent characters (act → cat)
	//
	// To find similar terms, the fuzzy query creates a set of all possible
	// variations, or expansions, of the search term within a specified edit
	// distance. The query then returns exact matches for each expansion.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
	Fuzzy CompleteFuzzier

	// Prefix returns documents that contain a specific prefix in a provided
	// field.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html
	Prefix CompletePrefixer

	// FunctionScore  allows you to modify the score of documents that are
	// retrieved by a query. This can be useful if, for example, a score
	// function is computationally expensive and it is sufficient to compute the
	// score on a filtered set of documents.
	//
	// To use function_score, the user has to define a query and one or more
	// functions, that compute a new score for each document returned by the
	// query.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-function-score-query.html
	FunctionScore FunctionScorer

	// ScoreScript uses a script to provide a custom score for returned
	// documents.
	//
	// The script_score query is useful if, for example, a scoring function is
	// expensive and you only need to calculate the score of a filtered set of
	// documents.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html
	ScriptScore ScriptScorer

	// Filters documents based on a provided script. The script query is
	// typically used in a filter context.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html
	Script Scripter

	// Range returns documents that contain terms within a provided range.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html
	Range Ranger

	// MatchAll matches all documents, giving them all a _score of 1.0.
	MatchAll *MatchAllQueryParams

	// MatchNone is the inverse of the match_all query, which matches no documents.
	MatchNone *MatchNoneQueryParams

	// Exists returns documents that contain an indexed value for a field.
	//
	// An indexed value may not exist for a document’s field due to a variety of
	// reasons:
	//
	// - The field in the source JSON is null or []
	//
	// - The field has "index" : false set in the mapping
	//
	// - The length of the field value exceeded an ignore_above setting in the
	// mapping
	//
	// - The field value was malformed and ignore_malformed was defined in the
	// mapping
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
	Exists Exister
	// Returns documents matching a positive query while reducing the relevance
	// score of documents that also match a negative query.
	//
	// You can use the boosting query to demote certain documents without
	// excluding them from the search results.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-boosting-query.html
	Boosting Boostinger

	// A query which wraps another query, but executes it in filter context. All
	// matching documents are given the same “constant” _score.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-constant-score-query.html
	ConstantScore ConstantScorer
	// Returns documents matching one or more wrapped queries, called query
	// clauses or clauses.
	//
	// If a returned document matches multiple query clauses, the dis_max query
	// assigns the document the highest relevance score from any matching
	// clause, plus a tie breaking increment for any additional matching
	// subqueries.
	//
	// You can use the dis_max to search for a term in fields mapped with
	// different boost factors.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-dis-max-query.html
	DisjunctionMax DisjunctionMaxer
	// Returns documents based on their IDs. This query uses document IDs stored
	// in the _id field.
	IDs IDser
	// Returns documents based on the order and proximity of matching terms.
	//
	// The intervals query uses matching rules, constructed from a small set of
	// definitions. These rules are then applied to terms from a specified
	// field.
	//
	// The definitions produce sequences of minimal intervals that span terms in
	// a body of text. These intervals can be further combined and filtered by
	// parent sources.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-intervals-query.html#intervals-all_of
	Intervals Intervalser
	// A match_bool_prefix query analyzes its input and constructs a bool query
	// from the terms. Each term except the last is used in a term query. The
	// last term is used in a prefix.
	MatchBoolPrefix MatchBoolPrefixer
	// The match_phrase query analyzes the text and creates a phrase query out
	// of the analyzed text.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-match-query-phrase.html
	MatchPhrase MatchPhraser
	// The multi-field version of the match query.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-multi-match-query.html#multi-match-types
	MultiMatch MultiMatcher
	// Returns documents based on a provided query string, using a parser with a strict syntax.
	//
	// This query uses a syntax to parse and split the provided query string based
	// on operators, such as AND or NOT. The query then analyzes each split text
	// independently before returning matching documents.
	//
	// You can use the query_string query to create a complex search that includes
	// wildcard characters, searches across multiple fields, and more. While
	// versatile, the query is strict and returns an error if the query string
	// includes any invalid syntax.
	QueryString QueryStringer
	// Returns documents based on a provided query string, using a parser with a
	// limited but fault-tolerant syntax.
	//
	// This query uses a simple syntax to parse and split the provided query
	// string into terms based on special operators. The query then analyzes
	// each term independently before returning matching documents.
	//
	// While its syntax is more limited than the query_string query, the
	// simple_query_string query does not return errors for invalid syntax.
	// Instead, it ignores any invalid parts of the query string.
	SimpleQueryString SimpleQueryStringer
	MatchPhrasePrefix MatchPhrasePrefixer
	GeoBoundingBox    GeoBoundingBoxer
	GeoDistance       GeoDistancer
	GeoShape          GeoShaper
	Shape             ShapeQuerier
	Nested            NestedQuerier
	HasChild          HasChilder
	HasParent         HasParenter
	ParentID          ParentIDer
	DistanceFeature   DistanceFeaturer
	MoreLikeThis      MoreLikeThiser
	Percolate         Percolater
	TermsSet          TermsSetter
	Wildcard          Wildcarder
	RankFeature       RankFeaturer
}

func (*QueryParams) Query

func (q *QueryParams) Query() (*Query, error)

type QueryRule

type QueryRule interface {
	Rule
	Ruler
	json.Marshaler
	json.Unmarshaler
}

func UnmarshalRule

func UnmarshalRule(data []byte) (QueryRule, error)

type QueryStringQuery

type QueryStringQuery struct {
	// contains filtered or unexported fields
}

func (QueryStringQuery) AllowLeadingWildcard

func (cp QueryStringQuery) AllowLeadingWildcard() bool

func (QueryStringQuery) AnalyzeWildcard

func (cp QueryStringQuery) AnalyzeWildcard() bool

If true, the query attempts to analyze wildcard terms in the query string. Defaults to false.

func (QueryStringQuery) Analyzer

func (ap QueryStringQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (QueryStringQuery) AutoGenerateSynonymsPhraseQuery

func (a QueryStringQuery) AutoGenerateSynonymsPhraseQuery() bool

AutoGenerateSynonymsPhraseQuery determines if match phrase queries are automatically created for multi-term synonyms. Defaults to true.

func (QueryStringQuery) Boost

func (b QueryStringQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*QueryStringQuery) Clause

func (qs *QueryStringQuery) Clause() (QueryClause, error)

func (*QueryStringQuery) Clear

func (qs *QueryStringQuery) Clear()

func (QueryStringQuery) Complete

func (QueryStringQuery) Complete()

func (QueryStringQuery) DefaultField

func (qs QueryStringQuery) DefaultField() string

func (QueryStringQuery) DefaultFuzzyRewrite

func (f QueryStringQuery) DefaultFuzzyRewrite() Rewrite

func (QueryStringQuery) DefaultOperator

func (o QueryStringQuery) DefaultOperator() Operator

func (QueryStringQuery) EnablePositionIncrements

func (epi QueryStringQuery) EnablePositionIncrements() bool

EnablePositionIncrements deteremines if all fields in the nested object are also added to the root document as standard (flat) fields. Defaults to false

func (QueryStringQuery) Fields

func (qs QueryStringQuery) Fields() []string

func (QueryStringQuery) Fuzziness

func (f QueryStringQuery) Fuzziness() string

Fuzziness is the maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

func (QueryStringQuery) FuzzyMaxExpansions

func (me QueryStringQuery) FuzzyMaxExpansions() int

FuzzyMaxExpansions is the maximum number of variations created. Defaults to 50.

func (QueryStringQuery) FuzzyRewrite

func (f QueryStringQuery) FuzzyRewrite() Rewrite

FuzzyRewrite is the method used to rewrite the query. See the rewrite parameter for valid values and more information.

If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite method of top_terms_blended_freqs_${max_expansions} by default.

func (QueryStringQuery) FuzzyTranspositions

func (ft QueryStringQuery) FuzzyTranspositions() bool

FuzzyTranspositions edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

func (*QueryStringQuery) IsEmpty

func (qs *QueryStringQuery) IsEmpty() bool

func (QueryStringQuery) Kind

func (QueryStringQuery) Kind() QueryKind

func (QueryStringQuery) Lenient

func (l QueryStringQuery) Lenient() bool

Lenient determines whether format-based errors, such as providing a text query value for a numeric field, are ignored. Defaults to false.

func (QueryStringQuery) MarshalJSON

func (qs QueryStringQuery) MarshalJSON() ([]byte, error)

func (QueryStringQuery) MaxDeterminizedStates

func (mds QueryStringQuery) MaxDeterminizedStates() int

func (QueryStringQuery) MinimumShouldMatch

func (msm QueryStringQuery) MinimumShouldMatch() string

func (QueryStringQuery) Name

func (n QueryStringQuery) Name() string

func (QueryStringQuery) PhraseSlop

func (mds QueryStringQuery) PhraseSlop() int

func (QueryStringQuery) Query

func (qs QueryStringQuery) Query() string

func (*QueryStringQuery) QueryString

func (qs *QueryStringQuery) QueryString() (*QueryStringQuery, error)

func (QueryStringQuery) QuoteAnalyzer

func (sq QueryStringQuery) QuoteAnalyzer() string

QuoteAnalyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

func (QueryStringQuery) QuoteFieldSuffix

func (qf QueryStringQuery) QuoteFieldSuffix() string

func (QueryStringQuery) Rewrite

func (r QueryStringQuery) Rewrite() Rewrite

func (*QueryStringQuery) SetAllowLeadingWildcard

func (cp *QueryStringQuery) SetAllowLeadingWildcard(v interface{}) error

func (*QueryStringQuery) SetAnalyzeWildcard

func (cp *QueryStringQuery) SetAnalyzeWildcard(v interface{}) error

SetAnalyzeWildcard sets analyze_wildcard to v

func (*QueryStringQuery) SetAnalyzer

func (ap *QueryStringQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*QueryStringQuery) SetAutoGenerateSynonymsPhraseQuery

func (a *QueryStringQuery) SetAutoGenerateSynonymsPhraseQuery(v interface{}) error

SetAutoGenerateSynonymsPhraseQuery sets AutoGenerateSynonymsPhraseQueryValue to v

func (*QueryStringQuery) SetBoost

func (b *QueryStringQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*QueryStringQuery) SetDefaultField

func (qs *QueryStringQuery) SetDefaultField(field string)

func (*QueryStringQuery) SetDefaultOperator

func (o *QueryStringQuery) SetDefaultOperator(v Operator) error

func (*QueryStringQuery) SetEnablePositionIncrements

func (epi *QueryStringQuery) SetEnablePositionIncrements(v interface{}) error

SetEnablePositionIncrements sets the EnablePositionIncrements Value to v

func (*QueryStringQuery) SetFields

func (qs *QueryStringQuery) SetFields(fields []string)

func (*QueryStringQuery) SetFuzziness

func (f *QueryStringQuery) SetFuzziness(v string)

SetFuzziness sets the fuzzinessValue to v

func (*QueryStringQuery) SetFuzzyMaxExpansions

func (me *QueryStringQuery) SetFuzzyMaxExpansions(v interface{}) error

func (*QueryStringQuery) SetFuzzyRewrite

func (f *QueryStringQuery) SetFuzzyRewrite(v Rewrite) error

SetFuzzyRewrite sets the value of FuzzyRewrite to v

func (*QueryStringQuery) SetFuzzyTranspositions

func (ft *QueryStringQuery) SetFuzzyTranspositions(fuzzyTranspositions interface{}) error

SetFuzzyTranspositions sets FuzzyTranspositions to v

func (*QueryStringQuery) SetLenient

func (l *QueryStringQuery) SetLenient(v bool)

SetLenient sets Lenient to v

func (*QueryStringQuery) SetMaxDeterminizedStates

func (mds *QueryStringQuery) SetMaxDeterminizedStates(v interface{}) error

func (*QueryStringQuery) SetMinimumShouldMatch

func (msm *QueryStringQuery) SetMinimumShouldMatch(v string)

func (*QueryStringQuery) SetName

func (n *QueryStringQuery) SetName(name string)

func (*QueryStringQuery) SetPhraseSlop

func (mds *QueryStringQuery) SetPhraseSlop(v interface{}) error

func (*QueryStringQuery) SetQuery

func (qs *QueryStringQuery) SetQuery(q string) error

func (QueryStringQuery) SetQuoteAnalyzer

func (sq QueryStringQuery) SetQuoteAnalyzer(v string)

SetQuoteAnalyzer sets search_quote_analyzer to v

func (*QueryStringQuery) SetQuoteFieldSuffix

func (qf *QueryStringQuery) SetQuoteFieldSuffix(quoteFieldSuffix string)

func (*QueryStringQuery) SetRewrite

func (r *QueryStringQuery) SetRewrite(v Rewrite) error

func (*QueryStringQuery) SetTieBreaker

func (tb *QueryStringQuery) SetTieBreaker(tieBreaker interface{}) error

func (*QueryStringQuery) SetTimeZone

func (tz *QueryStringQuery) SetTimeZone(v string)

func (QueryStringQuery) TimeZone

func (tz QueryStringQuery) TimeZone() string

func (*QueryStringQuery) UnmarshalJSON

func (qs *QueryStringQuery) UnmarshalJSON(data []byte) error

type QueryStringQueryParams

type QueryStringQueryParams struct {
	// (Required, string) Query string you wish to parse and use for search. See
	// Query string syntax.
	Query string `json:"query"`
	// (Optional, string) Default field you wish to search if no field is
	// provided in the query string.
	//
	// Defaults to the index.query.default_field index setting, which has a
	// default value of *. The * value extracts all fields that are eligible for
	// term queries and filters the metadata fields. All extracted fields are
	// then combined to build a query if no prefix is specified.
	//
	// Searching across all eligible fields does not include nested documents.
	// Use a nested query to search those documents.
	//
	// For mappings with a large number of fields, searching across all eligible
	// fields could be expensive.
	//
	// There is a limit on the number of fields that can be queried at once. It
	// is defined by the indices.query.bool.max_clause_count search setting,
	// which defaults to 1024.
	DefaultField string `json:"default_field,omitempty"`
	// (Optional, Boolean) If true, the wildcard characters * and ? are allowed
	// as the first character of the query string. Defaults to true.
	AllowLeadingWildcard interface{} `json:"allow_leading_wildcard,omitempty"`
	// (Optional, Boolean) If true, the query attempts to analyze wildcard terms
	// in the query string. Defaults to false.
	AnalyzeWildcard interface{} `json:"analyze_wildcard,omitempty"`
	// (Optional, string) Analyzer used to convert text in the query string into
	// tokens. Defaults to the index-time analyzer mapped for the default_field.
	// If no analyzer is mapped, the index’s default analyzer is used.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional, Boolean) If true, match phrase queries are automatically
	// created for multi-term synonyms. Defaults to true.
	AutoGenerateSynonymsPhraseQuery interface{} `json:"auto_generate_synonyms_phrase_query,omitempty"`
	// (Optional, float) Floating point number used to decrease or increase the
	// relevance scores of the query. Defaults to 1.0.
	//
	// Boost values are relative to the default value of 1.0. A boost value
	// between 0 and 1.0 decreases the relevance score. A value greater than 1.0
	// increases the relevance score.
	Boost interface{} `json:"boost,omitempty"`
	// (Optional, string) Default boolean logic used to interpret text in the
	// query string if no operators are specified. Valid values are:
	//
	// - OR (Default)
	//
	// - AND
	DefaultOperator Operator `json:"default_operator,omitempty"`
	// (Optional, Boolean) If true, enable position increments in queries
	// constructed from a query_string search. Defaults to true.
	EnablePositionIncrements interface{} `json:"enable_position_increments,omitempty"`

	// (Optional, array of strings) Array of fields you wish to search.
	//
	// You can use this parameter query to search across multiple fields. See
	// Search multiple fields.
	Fields []string `json:"fields,omitempty"`
	// (Optional, string) Maximum edit distance allowed for matching. See
	// Fuzziness for valid values and more information.
	Fuzziness string `json:"fuzziness,omitempty"`
	// (Optional, integer) Maximum number of terms to which the query expands
	// for fuzzy matching. Defaults to 50.
	FuzzyMaxExpansions interface{} `json:"fuzzy_max_expansions,omitempty"`
	// (Optional, Boolean) If true, edits for fuzzy matching include
	// transpositions of two adjacent characters (ab → ba). Defaults to true.
	FuzzyTranspositions interface{} `json:"fuzzy_transpositions,omitempty"`
	// (Optional, Boolean) If true, format-based errors, such as providing a
	// text value for a numeric field, are ignored. Defaults to false.
	Lenient bool `json:"lenient,omitempty"`
	// (Optional, integer) Maximum number of automaton states required for the
	// query. Default is 10000.
	//
	// Elasticsearch uses Apache Lucene internally to parse regular expressions.
	// Lucene converts each regular expression to a finite automaton containing
	// a number of determinized states.
	//
	// You can use this parameter to prevent that conversion from
	// unintentionally consuming too many resources. You may need to increase
	// this limit to run complex regular expressions.
	MaxDeterminizedStates interface{} `json:"max_determinized_states,omitempty"`
	// (Optional, string) Minimum number of clauses that must match for a
	// document to be returned. See the minimum_should_match parameter for valid
	// values and more information. See How minimum_should_match works for an
	// example.
	MinimumShouldMatch string `json:"minimum_should_match,omitempty"`
	// (Optional, string) Analyzer used to convert quoted text in the query
	// string into tokens. Defaults to the search_quote_analyzer mapped for the
	// default_field.
	//
	// For quoted text, this parameter overrides the analyzer specified in the
	// analyzer parameter.
	QuoteAnalyzer string `json:"quote_analyzer,omitempty"`
	// (Optional, integer) Maximum number of positions allowed between matching
	// tokens for phrases. Defaults to 0. If 0, exact phrase matches are
	// required. Transposed terms have a slop of 2.
	PhraseSlop interface{} `json:"phrase_slop,omitempty"`
	// (Optional, string) Suffix appended to quoted text in the query string.
	//
	// You can use this suffix to use a different analysis method for exact
	// matches. See Mixing exact search with stemming.
	QuoteFieldSuffix string `json:"quote_field_suffix,omitempty"`
	// (Optional, string) Method used to rewrite the query. For valid values and
	// more information, see the rewrite parameß
	Rewrite Rewrite `json:"rewrite,omitempty"`
	// (Optional, string) Coordinated Universal Time (UTC) offset or IANA time
	// zone used to convert date values in the query string to UTC.
	//
	// Valid values are ISO 8601 UTC offsets, such as +01:00 or -08:00, and IANA
	// time zone IDs, such as America/Los_Angeles.
	TimeZone   string      `json:"time_zone,omitempty"`
	TieBreaker interface{} `json:"tie_breaker,omitempty"`
	Name       string      `json:"_name,omitempty"`
	// contains filtered or unexported fields
}

func (QueryStringQueryParams) Clause

func (QueryStringQueryParams) Complete

func (QueryStringQueryParams) Complete()

func (QueryStringQueryParams) Kind

func (QueryStringQueryParams) QueryString

func (p QueryStringQueryParams) QueryString() (*QueryStringQuery, error)

type QueryStringer

type QueryStringer interface {
	QueryString() (*QueryStringQuery, error)
}

type Queryset

type Queryset interface {
	Queries() (Queries, error)
}

type RandomScoreFunc

type RandomScoreFunc struct {
	Field string
	// float (Optional)
	Weight interface{}
	// In case you want scores to be reproducible, it is possible to provide a
	// seed and field. The final score will then be computed based on this seed,
	// the minimum value of field for the considered document and a salt that is
	// computed based on the index name and shard id so that documents that have
	// the same value but are stored in different indexes get different scores.
	// Note that documents that are within the same shard and have the same
	// value for field will however get the same score, so it is usually
	// desirable to use a field that has unique values for all documents. A good
	// default choice might be to use the _seq_no field, whose only drawback is
	// that scores will change if the document is updated since update
	// operations also update the value of the _seq_no field.
	//
	// It was possible to set a seed without setting a field, but this has been
	// deprecated as this requires loading fielddata on the _id field which
	// consumes a lot of memory.
	Seed interface{}

	Filter CompleteClauser
}

RandomScoreFunc generates scores that are uniformly distributed from 0 up to but not including 1. By default, it uses the internal Lucene doc ids as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.

In case you want scores to be reproducible, it is possible to provide a seed and field. The final score will then be computed based on this seed, the minimum value of field for the considered document and a salt that is computed based on the index name and shard id so that documents that have the same value but are stored in different indexes get different scores. Note that documents that are within the same shard and have the same value for field will however get the same score, so it is usually desirable to use a field that has unique values for all documents. A good default choice might be to use the _seq_no field, whose only drawback is that scores will change if the document is updated since update operations also update the value of the _seq_no field.

func (RandomScoreFunc) FuncKind

func (RandomScoreFunc) FuncKind() FuncKind

func (RandomScoreFunc) Function

func (rs RandomScoreFunc) Function() (Function, error)

func (RandomScoreFunc) RandomScoreFunction

func (rs RandomScoreFunc) RandomScoreFunction() (*RandomScoreFunction, error)

type RandomScoreFunction

type RandomScoreFunction struct {
	// contains filtered or unexported fields
}

func (*RandomScoreFunction) Filter

func (rs *RandomScoreFunction) Filter() QueryClause

func (*RandomScoreFunction) FuncKind

func (rs *RandomScoreFunction) FuncKind() FuncKind

func (RandomScoreFunction) MarshalJSON

func (rs RandomScoreFunction) MarshalJSON() ([]byte, error)

func (*RandomScoreFunction) SetField

func (rs *RandomScoreFunction) SetField(field string)

func (*RandomScoreFunction) SetFilter

func (rs *RandomScoreFunction) SetFilter(filter CompleteClauser) error

func (*RandomScoreFunction) SetSeed

func (rs *RandomScoreFunction) SetSeed(seed interface{}) error

func (*RandomScoreFunction) SetWeight

func (b *RandomScoreFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*RandomScoreFunction) Weight

func (b *RandomScoreFunction) Weight() float64

type RangeField

type RangeField interface {
	Field
	WithCoerce
	WithIndex
	WithStore
}

type RangeQuery

type RangeQuery struct {
	// contains filtered or unexported fields
}

func (RangeQuery) Boost

func (b RangeQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*RangeQuery) Clause

func (r *RangeQuery) Clause() (QueryClause, error)

func (*RangeQuery) Clear

func (r *RangeQuery) Clear()

func (RangeQuery) Complete

func (RangeQuery) Complete()

func (RangeQuery) Format

func (f RangeQuery) Format() string

Format is the format(s) that the that can be parsed. Defaults to strict_date_optional_time||epoch_millis.

Multiple formats can be seperated by ||

func (RangeQuery) GreaterThan

func (r RangeQuery) GreaterThan() dynamic.StringNumberOrTime

func (RangeQuery) GreaterThanOrEqualTo

func (r RangeQuery) GreaterThanOrEqualTo() dynamic.StringNumberOrTime

func (*RangeQuery) IsEmpty

func (r *RangeQuery) IsEmpty() bool

func (RangeQuery) Kind

func (RangeQuery) Kind() QueryKind

func (RangeQuery) LessThan

func (r RangeQuery) LessThan() dynamic.StringNumberOrTime

func (RangeQuery) LessThanOrEqualTo

func (r RangeQuery) LessThanOrEqualTo() dynamic.StringNumberOrTime

func (RangeQuery) MarshalBSON

func (r RangeQuery) MarshalBSON() ([]byte, error)

func (RangeQuery) MarshalJSON

func (r RangeQuery) MarshalJSON() ([]byte, error)

func (RangeQuery) Name

func (n RangeQuery) Name() string

func (RangeQuery) Relation

func (r RangeQuery) Relation() Relation

Relation indicates how the range query matches values for range fields.

func (*RangeQuery) Set

func (r *RangeQuery) Set(field string, ranger Ranger) error

func (*RangeQuery) SetBoost

func (b *RangeQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*RangeQuery) SetFormat

func (f *RangeQuery) SetFormat(v string)

func (*RangeQuery) SetName

func (n *RangeQuery) SetName(name string)

func (*RangeQuery) SetRelation

func (r *RangeQuery) SetRelation(v Relation) error

SetRelation sets Relation to v

func (*RangeQuery) SetTimeZone

func (tz *RangeQuery) SetTimeZone(v string)

func (RangeQuery) TimeZone

func (tz RangeQuery) TimeZone() string

func (*RangeQuery) UnmarshalBSON

func (r *RangeQuery) UnmarshalBSON(data []byte) error

func (*RangeQuery) UnmarshalJSON

func (r *RangeQuery) UnmarshalJSON(data []byte) error

type RangeQueryParams

type RangeQueryParams struct {
	Field                string
	GreaterThan          interface{}
	GreaterThanOrEqualTo interface{}
	LessThan             interface{}
	LessThanOrEqualTo    interface{}
	Format               string
	TimeZone             string
	Boost                interface{}
	Name                 string
	Relation             Relation
	// contains filtered or unexported fields
}

RangeQueryParams returns documents that contain terms within a provided range.

func (RangeQueryParams) Clause

func (r RangeQueryParams) Clause() (QueryClause, error)

func (RangeQueryParams) Complete

func (RangeQueryParams) Complete()

func (RangeQueryParams) Kind

func (r RangeQueryParams) Kind() QueryKind

func (RangeQueryParams) Range

func (r RangeQueryParams) Range() (*RangeQuery, error)

type Ranger

type Ranger interface {
	Range() (*RangeQuery, error)
}

type RankFeatureField

type RankFeatureField struct {
	// contains filtered or unexported fields
}

A RankFeatureField can index numbers so that they can later be used to boost documents in queries with a rank_feature query.

Rank features that correlate negatively with the score should set positive_score_impact to false (defaults to true). This will be used by the rank_feature query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. For instance in web search, the url length is a commonly used feature which correlates negatively with scores.

https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-feature.html

func NewRankFeatureField

func NewRankFeatureField(params RankFeatureFieldParams) (*RankFeatureField, error)

func (*RankFeatureField) Field

func (f *RankFeatureField) Field() (Field, error)

func (RankFeatureField) MarshalBSON

func (f RankFeatureField) MarshalBSON() ([]byte, error)

func (RankFeatureField) MarshalJSON

func (f RankFeatureField) MarshalJSON() ([]byte, error)

func (RankFeatureField) PositiveScoreImpact

func (psi RankFeatureField) PositiveScoreImpact() bool

PositiveScoreImpact is used by rank_feature queries to modify the scoring formula in such a way that the score increases or decreases the value of the feature

func (*RankFeatureField) SetPositiveScoreImpact

func (psi *RankFeatureField) SetPositiveScoreImpact(v interface{}) error

SetPositiveScoreImpact sets the PositiveScoreImpact Value to v

func (RankFeatureField) Type

func (RankFeatureField) Type() FieldType

func (*RankFeatureField) UnmarshalBSON

func (f *RankFeatureField) UnmarshalBSON(data []byte) error

func (*RankFeatureField) UnmarshalJSON

func (f *RankFeatureField) UnmarshalJSON(data []byte) error

type RankFeatureFieldParams

type RankFeatureFieldParams struct {
	// PositiveScoreImpact is used by rank_feature queries to modify the scoring
	// formula in such a way that the score increases or decreases the value of
	// the feature
	//
	// (Bool, optional)
	PositiveScoreImpact interface{} `json:"positive_score_impact,omitempty"`
}

func (RankFeatureFieldParams) Field

func (p RankFeatureFieldParams) Field() (Field, error)

func (RankFeatureFieldParams) RankFeature

func (p RankFeatureFieldParams) RankFeature() (*RankFeatureField, error)

func (RankFeatureFieldParams) Type

type RankFeatureQuery

type RankFeatureQuery struct {
	// contains filtered or unexported fields
}

func (RankFeatureQuery) Boost

func (b RankFeatureQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*RankFeatureQuery) Clause

func (q *RankFeatureQuery) Clause() (QueryClause, error)

func (*RankFeatureQuery) Clear

func (q *RankFeatureQuery) Clear()

func (RankFeatureQuery) Complete

func (RankFeatureQuery) Complete()

func (RankFeatureQuery) Field

func (f RankFeatureQuery) Field() string

func (RankFeatureQuery) Funcs

func (q RankFeatureQuery) Funcs() []string

func (*RankFeatureQuery) IsEmpty

func (q *RankFeatureQuery) IsEmpty() bool

func (RankFeatureQuery) Kind

func (RankFeatureQuery) Kind() QueryKind

func (*RankFeatureQuery) Linear

func (q *RankFeatureQuery) Linear() *LinearFunction

func (*RankFeatureQuery) Log

func (q *RankFeatureQuery) Log() *LogFunction

func (RankFeatureQuery) MarshalBSON

func (q RankFeatureQuery) MarshalBSON() ([]byte, error)

func (RankFeatureQuery) MarshalJSON

func (q RankFeatureQuery) MarshalJSON() ([]byte, error)

func (RankFeatureQuery) Name

func (n RankFeatureQuery) Name() string

func (*RankFeatureQuery) RankFeature

func (q *RankFeatureQuery) RankFeature() (*RankFeatureQuery, error)

func (*RankFeatureQuery) Saturation

func (q *RankFeatureQuery) Saturation() *SaturationFunction

func (*RankFeatureQuery) SetBoost

func (b *RankFeatureQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*RankFeatureQuery) SetField

func (f *RankFeatureQuery) SetField(field string) error

func (*RankFeatureQuery) SetLinear

func (q *RankFeatureQuery) SetLinear(sat LinearFunctioner) error

func (*RankFeatureQuery) SetLog

func (q *RankFeatureQuery) SetLog(log LogFunctioner) error

func (*RankFeatureQuery) SetName

func (n *RankFeatureQuery) SetName(name string)

func (*RankFeatureQuery) SetSaturation

func (q *RankFeatureQuery) SetSaturation(sat SaturationFunctioner) error

func (*RankFeatureQuery) SetSigmoid

func (q *RankFeatureQuery) SetSigmoid(sig SigmoidFunctioner) error

func (*RankFeatureQuery) Sigmoid

func (q *RankFeatureQuery) Sigmoid() *SigmoidFunction

func (*RankFeatureQuery) UnmarshalBSON

func (q *RankFeatureQuery) UnmarshalBSON(data []byte) error

func (*RankFeatureQuery) UnmarshalJSON

func (q *RankFeatureQuery) UnmarshalJSON(data []byte) error

type RankFeatureQueryParams

type RankFeatureQueryParams struct {
	// (Required) rank_feature or rank_features field used to boost
	// relevance scores.
	Field string
	// (Optional, float) Floating point number used to decrease or increase
	// relevance scores. Defaults to 1.0.
	//
	// Boost values are relative to the default value of 1.0. A boost value
	// between 0 and 1.0 decreases the relevance score. A value greater than 1.0
	// increases the relevance score.
	Boost interface{}
	// (Optional) Saturation function used to boost relevance
	// scores based on the value of the rank feature field. If no function is
	// provided, the rank_feature query defaults to the saturation function.
	//
	// Only one function saturation, log, sigmoid or linear can be provided.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-rank-feature-query.html#rank-feature-query-logarithm
	Saturation SaturationFunctioner

	// (Optional) Logarithmic function used to boost relevance scores based on
	// the value of the rank feature field.
	//
	// Only one function saturation, log, sigmoid or linear can be provided.
	Log LogFunctioner

	// (Optional) Sigmoid function used to boost relevance scores based on the
	// value of the rank feature field. See Sigmoid for more information.
	//
	// Only one function saturation, log, sigmoid or linear can be provided.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-rank-feature-query.html#rank-feature-query-sigmoid
	Sigmoid SigmoidFunctioner
	// (Optional) Linear function used to boost relevance scores based on the
	// value of the rank feature field. See Linear for more information.
	//
	// Only one function saturation, log, sigmoid or linear can be provided.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/7.12/query-dsl-rank-feature-query.html#rank-feature-query-linear
	Linear LinearFunctioner
	Name   string
	// contains filtered or unexported fields
}

func (RankFeatureQueryParams) Clause

func (RankFeatureQueryParams) Complete

func (RankFeatureQueryParams) Complete()

func (RankFeatureQueryParams) Kind

func (RankFeatureQueryParams) RankFeature

func (p RankFeatureQueryParams) RankFeature() (*RankFeatureQuery, error)

type RankFeaturer

type RankFeaturer interface {
	RankFeature() (*RankFeatureQuery, error)
}

type RankFeaturesField

type RankFeaturesField struct {
	// contains filtered or unexported fields
}

A RankFeaturesField can index numeric feature vectors, so that they can later be used to boost documents in queries with a rank_feature query.

It is analogous to the RankFeature data type but is better suited when the list of features is sparse so that it wouldn’t be reasonable to add one field to the mappings for each of them.

https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-features.html

func NewRankFeaturesField

func NewRankFeaturesField(params RankFeaturesFieldParams) (*RankFeaturesField, error)

func (*RankFeaturesField) Field

func (f *RankFeaturesField) Field() (Field, error)

func (RankFeaturesField) MarshalBSON

func (f RankFeaturesField) MarshalBSON() ([]byte, error)

func (RankFeaturesField) MarshalJSON

func (f RankFeaturesField) MarshalJSON() ([]byte, error)

func (RankFeaturesField) PositiveScoreImpact

func (psi RankFeaturesField) PositiveScoreImpact() bool

PositiveScoreImpact is used by rank_feature queries to modify the scoring formula in such a way that the score increases or decreases the value of the feature

func (*RankFeaturesField) SetPositiveScoreImpact

func (psi *RankFeaturesField) SetPositiveScoreImpact(v interface{}) error

SetPositiveScoreImpact sets the PositiveScoreImpact Value to v

func (RankFeaturesField) Type

func (*RankFeaturesField) UnmarshalBSON

func (f *RankFeaturesField) UnmarshalBSON(data []byte) error

func (*RankFeaturesField) UnmarshalJSON

func (f *RankFeaturesField) UnmarshalJSON(data []byte) error

type RankFeaturesFieldParams

type RankFeaturesFieldParams struct {
	// PositiveScoreImpact is used by rank_feature queries to modify the scoring
	// formula in such a way that the score increases or decreases the value of
	// the feature
	//
	// (Bool, optional)
	PositiveScoreImpact interface{} `json:"positive_score_impact,omitempty"`
}

func (RankFeaturesFieldParams) Field

func (p RankFeaturesFieldParams) Field() (Field, error)

func (RankFeaturesFieldParams) RankFeatures

func (p RankFeaturesFieldParams) RankFeatures() (*RankFeaturesField, error)

func (RankFeaturesFieldParams) Type

type RegexpQuery

type RegexpQuery struct {
	// contains filtered or unexported fields
}

func (*RegexpQuery) Clause

func (q *RegexpQuery) Clause() (QueryClause, error)

func (*RegexpQuery) Clear

func (q *RegexpQuery) Clear()

func (RegexpQuery) Complete

func (RegexpQuery) Complete()

func (*RegexpQuery) IsEmpty

func (q *RegexpQuery) IsEmpty() bool

func (RegexpQuery) Kind

func (RegexpQuery) Kind() QueryKind

func (RegexpQuery) MarshalBSON

func (q RegexpQuery) MarshalBSON() ([]byte, error)

func (RegexpQuery) MarshalJSON

func (q RegexpQuery) MarshalJSON() ([]byte, error)

func (RegexpQuery) Name

func (n RegexpQuery) Name() string

func (*RegexpQuery) Regexp

func (q *RegexpQuery) Regexp() (*RegexpQuery, error)

func (*RegexpQuery) SetName

func (n *RegexpQuery) SetName(name string)

func (*RegexpQuery) UnmarshalBSON

func (q *RegexpQuery) UnmarshalBSON(data []byte) error

func (*RegexpQuery) UnmarshalJSON

func (q *RegexpQuery) UnmarshalJSON(data []byte) error

type RegexpQueryParams

type RegexpQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (RegexpQueryParams) Clause

func (p RegexpQueryParams) Clause() (QueryClause, error)

func (RegexpQueryParams) Complete

func (RegexpQueryParams) Complete()

func (RegexpQueryParams) Kind

func (RegexpQueryParams) Regexp

func (p RegexpQueryParams) Regexp() (*RegexpQuery, error)

type Regexper

type Regexper interface {
	Regexp() (*RegexpQuery, error)
}

type Relation

type Relation string
const (
	RelationUnspecified Relation = ""
	//RelationIntersects matches documents with a range field value that
	//intersects the query’s range.
	RelationIntersects Relation = "INTERSECTS"
	// RelationContains matches documents with a range field value that entirely
	// contains the query’s range.
	RelationContains Relation = "CONTAINS"
	// RelationWithin matches documents with a range field value entirely within
	// the query’s range.
	RelationWithin Relation = "WITHIN"
)

func (Relation) IsValid

func (r Relation) IsValid() bool

func (Relation) MarshalBSON

func (r Relation) MarshalBSON() ([]byte, error)

func (Relation) MarshalJSON

func (r Relation) MarshalJSON() ([]byte, error)

func (Relation) String

func (r Relation) String() string

func (*Relation) UnmarshalBSON

func (r *Relation) UnmarshalBSON(data []byte) error

func (*Relation) UnmarshalJSON

func (r *Relation) UnmarshalJSON(data []byte) error

type Relations

Relations are used on JoinFields

https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html

you can treat this like a map[string][]string

r := picker.Relations{"myField": []string{"abc"}}
r["myOtherField"] = []string{"other", "relation"}

type Retries

type Retries struct {
	Bulk   int64 `json:"bulk"`
	Search int64 `json:"search"`
}

type Rewrite

type Rewrite string

Rewrite as defined by:

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-term-rewrite.html

const (
	// RewriteKindConstantScore uses the constant_score_boolean method for fewer matching
	// terms. Otherwise, this method finds all matching terms in sequence and
	// returns matching documents using a bit set.
	RewriteConstantScore Rewrite = "constant_score"

	// RewriteKindConstantScoreBoolean assigns each document a relevance score equal to the
	// boost parameter.
	//
	// This method changes the original query to a bool query. This bool query
	// contains a should clause and term query for each matching term.
	//
	// This method can cause the final bool query to exceed the clause limit in the
	// indices.query.bool.max_clause_count setting. If the query exceeds this limit,
	// Elasticsearch returns an error.
	RewriteConstantScoreBoolean Rewrite = "constant_score_boolean"

	// RewriteKindScoringBoolean calculates a relevance score for each matching document.
	//
	// This method changes the original query to a bool query. This bool query
	// contains a should clause and term query for each matching term.
	//
	// This method can cause the final bool query to exceed the clause limit in the
	// indices.query.bool.max_clause_count setting. If the query exceeds this limit,
	// Elasticsearch returns an error.
	RewriteScoringBoolean Rewrite = "scoring_boolean"

	// RewriteKindTopTermsBlendedFreqsN calculates a relevance score for each
	// matching document as if all terms had the same frequency. This frequency
	// is the maximum frequency of all matching terms.
	//
	// This method changes the original query to a bool query. This bool query
	// contains a should clause and term query for each matching term.
	//
	// The final bool query only includes term queries for the top N scoring
	// terms.
	//
	// You can use this method to avoid exceeding the clause limit in the
	// indices.query.bool.max_clause_count setting.
	//
	RewriteTopTermsBlendedFreqsN Rewrite = "top_terms_blended_freqs_N"

	// RewriteKindTopTermsBoostN Assigns each matching document a relevance
	// score equal to the boost parameter.
	//
	// This method changes the original query to a bool query. This bool query
	// contains a should clause and term query for each matching term.
	//
	// The final bool query only includes term queries for the top N terms.
	//
	// You can use this method to avoid exceeding the clause limit in the
	// indices.query.bool.max_clause_count setting.
	RewriteTopTermsBoostN Rewrite = "top_terms_boost_N"

	// RewriteTopTermsN calculates a relevance score for each matching document.
	//
	// This method changes the original query to a bool query. This bool query
	// contains a should clause and term query for each matching term.
	//
	// The final bool query only includes term queries for the top N scoring terms.
	//
	// You can use this method to avoid exceeding the clause limit in the
	// indices.query.bool.max_clause_count setting.
	RewriteTopTermsN Rewrite = "top_terms_N"
)

func (Rewrite) IsValid

func (r Rewrite) IsValid() bool

func (Rewrite) String

func (r Rewrite) String() string

type Rule

type Rule interface {
	Type() RuleType
}

type RuleFilter

type RuleFilter struct {
	// contains filtered or unexported fields
}

func (*RuleFilter) After

func (r *RuleFilter) After() *Query

After - Query used to return intervals that follow an interval from the filter rule.

func (*RuleFilter) Before

func (r *RuleFilter) Before() *Query

Before - Query used to return intervals that occur before an interval from the filter rule.

func (*RuleFilter) ContainedBy

func (r *RuleFilter) ContainedBy() *Query

ContainedBy - Query used to return intervals contained by an interval from the filter rule.

func (*RuleFilter) Containing

func (r *RuleFilter) Containing() *Query

Containing - Query used to return intervals that contain an interval from the filter rule.

func (RuleFilter) MarshalBSON

func (r RuleFilter) MarshalBSON() ([]byte, error)

func (RuleFilter) MarshalJSON

func (r RuleFilter) MarshalJSON() ([]byte, error)

func (*RuleFilter) NotContainedBy

func (r *RuleFilter) NotContainedBy() *Query

NotContainedBy - Query used to return intervals that are not contained by an interval from the filter rule.

func (*RuleFilter) NotContaining

func (r *RuleFilter) NotContaining() *Query

NotContaining - Query used to return intervals that do not contain an interval from the filter rule.

func (*RuleFilter) NotOverlapping

func (r *RuleFilter) NotOverlapping() *Query

NotOverlapping - Query used to return intervals that do not overlap with an interval from the filter rule.

func (*RuleFilter) Overlapping

func (r *RuleFilter) Overlapping() *Query

Overlapping - Query used to return intervals that overlap with an interval from the filter rule.

func (*RuleFilter) RuleFilter

func (r *RuleFilter) RuleFilter() (*RuleFilter, error)

func (*RuleFilter) Script

func (r *RuleFilter) Script() *Script

func (*RuleFilter) SetAfter

func (r *RuleFilter) SetAfter(query Querier) error

func (*RuleFilter) SetBefore

func (r *RuleFilter) SetBefore(query Querier) error

func (*RuleFilter) SetContainedBy

func (r *RuleFilter) SetContainedBy(query Querier) error

func (*RuleFilter) SetContaining

func (r *RuleFilter) SetContaining(query Querier) error

func (*RuleFilter) SetNotContainedBy

func (r *RuleFilter) SetNotContainedBy(query Querier) error

func (*RuleFilter) SetNotContaining

func (r *RuleFilter) SetNotContaining(query Querier) error

func (*RuleFilter) SetNotOverlapping

func (r *RuleFilter) SetNotOverlapping(query Querier) error

func (*RuleFilter) SetOverlapping

func (r *RuleFilter) SetOverlapping(query Querier) error

func (*RuleFilter) SetScript

func (r *RuleFilter) SetScript(script *Script) error

func (*RuleFilter) UnmarshalBSON

func (r *RuleFilter) UnmarshalBSON(data []byte) error

func (*RuleFilter) UnmarshalJSON

func (r *RuleFilter) UnmarshalJSON(data []byte) error

type RuleFilterParams

type RuleFilterParams struct {
	// (Optional) Query used to return intervals that follow an
	// interval from the filter rule.
	After Querier
	// (Optional) Query used to return intervals that occur before
	// an interval from the filter rule.
	Before Querier
	// (Optional) Query used to return intervals contained by an
	// interval from the filter rule.
	ContainedBy Querier
	// (Optional) Query used to return intervals that contain an
	// interval from the filter rule.
	Containing Querier
	// (Optional) Query used to return intervals that are not
	// contained by an interval from the filter rule.
	NotContainedBy Querier
	// (Optional) Query used to return intervals that do not
	// contain an interval from the filter rule.
	NotContaining Querier
	// (Optional) Query used to return intervals that do not overlap with an interval from the filter rule.
	NotOverlapping Querier
	// (Optional) Query used to return intervals that overlap with an interval from the filter rule.
	Overlapping Querier
	// Optional) Script used to return matching documents. This script must return a boolean value, true or false. See Script filters for an example.
	Script *Script
}

func (RuleFilterParams) RuleFilter

func (p RuleFilterParams) RuleFilter() (*RuleFilter, error)

type RuleFilterer

type RuleFilterer interface {
	RuleFilter() (*RuleFilter, error)
}

type RuleType

type RuleType string
const (
	RuleTypeMatch    RuleType = "match"
	RuleTypePrefix   RuleType = "prefix"
	RuleTypeWildcard RuleType = "wildcard"
	RuleTypeFuzzy    RuleType = "fuzzy"
	RuleTypeAllOf    RuleType = "all_of"
	RuleTypeAnyOf    RuleType = "any_of"
)

func (RuleType) String

func (r RuleType) String() string

type Ruler

type Ruler interface {
	Rule() (QueryRule, error)
}

type Rules

type Rules []QueryRule

func (Rules) MarshalJSON

func (rs Rules) MarshalJSON() ([]byte, error)

func (*Rules) UnmarshalJSON

func (rs *Rules) UnmarshalJSON(data []byte) error

type Ruleset

type Ruleset []Ruler

func (*Ruleset) Add

func (rs *Ruleset) Add(rule Ruler) (QueryRule, error)

func (Ruleset) MarshalJSON

func (rs Ruleset) MarshalJSON() ([]byte, error)

func (Ruleset) Rules

func (rs Ruleset) Rules() (Rules, error)

func (*Ruleset) UnmarshalJSON

func (rs *Ruleset) UnmarshalJSON(data []byte) error

type RuntimeMappingField

type RuntimeMappingField struct {
	Kind   RuntimeMappingKind `bson:"type" json:"type"`
	Script string             `bson:"script,omitempty" json:"script,omitempty"`
}

type RuntimeMappingKind

type RuntimeMappingKind string
const (
	RMTBoolean  RuntimeMappingKind = "boolean"
	RMTDate     RuntimeMappingKind = "date"
	RMTDouble   RuntimeMappingKind = "double"
	RMTGeoPoint RuntimeMappingKind = "geo_point"
	RMTIP       RuntimeMappingKind = "ip"
	RMTKeyword  RuntimeMappingKind = "keyword"
	RMTLong     RuntimeMappingKind = "long"
)

type RuntimeMappings

type RuntimeMappings map[string]RuntimeMappingField

type SaturationFunction

type SaturationFunction struct {
	// contains filtered or unexported fields
}

SaturationFunction gives a score equal to S / (S + pivot), where S is the value of the rank feature field and pivot is a configurable pivot value so that the result will be less than 0.5 if S is less than pivot and greater than 0.5 otherwise. Scores are always (0,1).

If the rank feature has a negative score impact then the function will be computed as pivot / (S + pivot), which decreases when S increases.

If a pivot value is not provided, Elasticsearch computes a default value equal to the approximate geometric mean of all rank feature values in the index.

func (SaturationFunction) MarshalBSON

func (s SaturationFunction) MarshalBSON() ([]byte, error)

func (SaturationFunction) MarshalJSON

func (s SaturationFunction) MarshalJSON() ([]byte, error)

func (SaturationFunction) Pivot

func (s SaturationFunction) Pivot() float64

func (*SaturationFunction) Saturation

func (s *SaturationFunction) Saturation() (*SaturationFunction, error)

func (*SaturationFunction) SetPivot

func (s *SaturationFunction) SetPivot(pivot interface{}) error

func (*SaturationFunction) UnmarshalBSON

func (s *SaturationFunction) UnmarshalBSON(data []byte) error

func (*SaturationFunction) UnmarshalJSON

func (s *SaturationFunction) UnmarshalJSON(data []byte) error

type SaturationFunctionParams

type SaturationFunctionParams struct {
	// (Optional, number)
	Pivot interface{}
}

SaturationFunctionParams gives a score equal to S / (S + pivot), where S is the value of the rank feature field and pivot is a configurable pivot value so that the result will be less than 0.5 if S is less than pivot and greater than 0.5 otherwise. Scores are always (0,1).

If the rank feature has a negative score impact then the function will be computed as pivot / (S + pivot), which decreases when S increases.

If a pivot value is not provided, Elasticsearch computes a default value equal to the approximate geometric mean of all rank feature values in the index.

If a pivot value is not provided, Elasticsearch computes a default value equal to the approximate geometric mean of all rank feature values in the index. We recommend using this default value if you haven’t had the opportunity to train a good pivot value.

func (SaturationFunctionParams) Saturation

type SaturationFunctioner

type SaturationFunctioner interface {
	Saturation() (*SaturationFunction, error)
}

type ScaledFloatField

type ScaledFloatField struct {
	// contains filtered or unexported fields
}

func NewScaledFloatField

func NewScaledFloatField(params ScaledFloatFieldParams) (*ScaledFloatField, error)

func (ScaledFloatField) Boost

func (b ScaledFloatField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (ScaledFloatField) Coerce

func (cp ScaledFloatField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (ScaledFloatField) DocValues

func (dv ScaledFloatField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*ScaledFloatField) Field

func (sf *ScaledFloatField) Field() (Field, error)

func (ScaledFloatField) IgnoreMalformed

func (im ScaledFloatField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (ScaledFloatField) Index

func (i ScaledFloatField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (ScaledFloatField) MarshalJSON

func (sf ScaledFloatField) MarshalJSON() ([]byte, error)

func (ScaledFloatField) Meta

func (m ScaledFloatField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (ScaledFloatField) NullValue

func (nv ScaledFloatField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (ScaledFloatField) ScalingFactor

func (sf ScaledFloatField) ScalingFactor() float64

ScalingFactor to use when encoding values. Values will be multiplied by this factor at index time and rounded to the closest long value. For instance, a scaled_float with a scaling_factor of 10 would internally store 2.34 as 23 and all search-time operations (queries, aggregations, sorting) will behave as if the document had a value of 2.3. High values of scaling_factor improve accuracy but also increase space requirements. This parameter is required.

func (*ScaledFloatField) SetBoost

func (b *ScaledFloatField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*ScaledFloatField) SetCoerce

func (cp *ScaledFloatField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*ScaledFloatField) SetDocValues

func (dv *ScaledFloatField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*ScaledFloatField) SetIgnoreMalformed

func (im *ScaledFloatField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*ScaledFloatField) SetIndex

func (i *ScaledFloatField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*ScaledFloatField) SetMeta

func (m *ScaledFloatField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*ScaledFloatField) SetNullValue

func (nv *ScaledFloatField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*ScaledFloatField) SetScalingFactor

func (sf *ScaledFloatField) SetScalingFactor(v interface{}) error

SetScalingFactor sets the ScalingFactorValue to v

func (*ScaledFloatField) SetStore

func (sa *ScaledFloatField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (ScaledFloatField) Store

func (sa ScaledFloatField) Store() bool

Store returns the StoreAttr Value or false

func (ScaledFloatField) Type

func (ScaledFloatField) Type() FieldType

func (*ScaledFloatField) UnmarshalJSON

func (sf *ScaledFloatField) UnmarshalJSON(data []byte) error

type ScaledFloatFieldParams

type ScaledFloatFieldParams struct {

	// A ScaledFloatField is a floating point number that is backed by a long,
	// scaled by a fixed double scaling factor.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
	ScalingFactor interface{} `json:"scaling_factor"`
	// Coercion attempts to clean up dirty values to fit the data type of a
	// field. (Optional, bool) Defaults to false.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/coerce.html
	Coerce interface{} `json:"coerce,omitempty"`
	// IgnoreMalformed determines if malformed numbers are ignored. If true,
	// malformed numbers are ignored. If false (default), malformed numbers
	// throw an exception and reject the whole document.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// (Optional, bool, default: true)
	//
	// Most fields are indexed by default, which makes them searchable. The
	// inverted index allows queries to look up the search term in unique sorted
	// list of terms, and from that immediately have access to the list of
	// documents that contain the term.
	//
	// Sorting, aggregations, and access to field values in scripts requires a
	// different data access pattern. Instead of looking up the term and finding
	// documents, we need to be able to look up the document and find the terms
	// that it has in a field.
	//
	// Doc values are the on-disk data structure, built at document index time,
	// which makes this data access pattern possible. They store the same values
	// as the _source but in a column-oriented fashion that is way more
	// efficient for sorting and aggregations. Doc values are supported on
	// almost all field types, with the notable exception of text and
	// annotated_text fields.
	//
	// All fields which support doc values have them enabled by default. If you
	// are sure that you don’t need to sort or aggregate on a field, or access
	// the field value from a script, you can disable doc values in order to
	// save disk space
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
	DocValues interface{} `json:"doc_values,omitempty"`
	// Index controls whether field values are indexed. It accepts true or false
	// and defaults to true. Fields that are not indexed are not queryable.
	// (Optional, bool)
	Index interface{} `json:"index,omitempty"`
	// NullValue parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	NullValue interface{} `json:"null_value,omitempty"`
	// WithStore is a mapping with a store paramter.
	//
	// By default, field values are indexed to make them searchable, but they are
	// not stored. This means that the field can be queried, but the original field
	// value cannot be retrieved.
	//
	// Usually this doesn’t matter. The field value is already part of the _source
	// field, which is stored by default. If you only want to retrieve the value of
	// a single field or of a few fields, instead of the whole _source, then this
	// can be achieved with source filtering.
	//
	// In certain situations it can make sense to store a field. For instance, if
	// you have a document with a title, a date, and a very large content field, you
	// may want to retrieve just the title and the date without having to extract
	// those fields from a large _source field
	//
	// Stored fields returned as arrays
	//
	// For consistency, stored fields are always returned as an array because there
	// is no way of knowing if the original field value was a single value, multiple
	// values, or an empty array.
	//
	// The original value can be retrieved from the _source field instead.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html
	Store interface{} `json:"store,omitempty"`
	// Metadata attached to the field. This metadata is opaque to Elasticsearch, it
	// is only useful for multiple applications that work on the same indices to
	// share meta information about fields such as units
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-field-meta.html#mapping-field-meta
	Meta Meta `json:"meta,omitempty"`

	// Deprecated
	Boost interface{} `json:"boost,omitempty"`
}

func (ScaledFloatFieldParams) Field

func (p ScaledFloatFieldParams) Field() (Field, error)

func (ScaledFloatFieldParams) ScaledFloat

func (p ScaledFloatFieldParams) ScaledFloat() (*ScaledFloatField, error)

func (ScaledFloatFieldParams) Type

type ScoreMode

type ScoreMode string
const (
	ScoreModeUnspecified ScoreMode = ""
	// ScoreModeMultiply - scores are multiplied (default)
	ScoreModeMultiply ScoreMode = "multiply"
	// ScoreModeSum - scores are summed
	ScoreModeSum ScoreMode = "sum"
	// ScoreModeAvg scores are averaged
	ScoreModeAvg ScoreMode = "avg"
	// ScoreModeFirst - the first function that has a matching filter is applied
	ScoreModeFirst ScoreMode = "first"
	// ScoreModeMax - maximum score is used
	ScoreModeMax ScoreMode = "max"
	// ScoreModeMin - minimum score is used
	ScoreModeMin  ScoreMode = "min"
	ScoreModeNone ScoreMode = "none"
)

func (*ScoreMode) IsValid

func (sm *ScoreMode) IsValid() bool

func (ScoreMode) String

func (sm ScoreMode) String() string

type Script

type Script struct {
	Lang   string
	Source string
	Params interface{}
}

func (*Script) Clear

func (s *Script) Clear()

func (*Script) IsEmpty

func (s *Script) IsEmpty() bool

func (Script) Script

func (s Script) Script() (*ScriptQuery, error)

type ScriptQuery

type ScriptQuery struct {
	// contains filtered or unexported fields
}

func (*ScriptQuery) Clause

func (s *ScriptQuery) Clause() (QueryClause, error)

func (*ScriptQuery) Clear

func (s *ScriptQuery) Clear()

func (ScriptQuery) Complete

func (ScriptQuery) Complete()

func (*ScriptQuery) DecodeParams

func (s *ScriptQuery) DecodeParams(val interface{}) error

func (*ScriptQuery) IsEmpty

func (s *ScriptQuery) IsEmpty() bool

func (ScriptQuery) Kind

func (ScriptQuery) Kind() QueryKind

func (ScriptQuery) Lang

func (s ScriptQuery) Lang() string

func (ScriptQuery) MarshalBSON

func (s ScriptQuery) MarshalBSON() ([]byte, error)

func (ScriptQuery) MarshalJSON

func (s ScriptQuery) MarshalJSON() ([]byte, error)

func (ScriptQuery) Name

func (n ScriptQuery) Name() string

func (ScriptQuery) Params

func (s ScriptQuery) Params() dynamic.JSON

func (*ScriptQuery) Set

func (s *ScriptQuery) Set(script Scripter) error

Set sets the ScriptQuery Options include:

  • picker.ScriptQuery

func (*ScriptQuery) SetName

func (n *ScriptQuery) SetName(name string)

func (*ScriptQuery) SetParams

func (s *ScriptQuery) SetParams(params interface{}) error

func (*ScriptQuery) SetScript

func (s *ScriptQuery) SetScript(script *Script) error

func (*ScriptQuery) Source

func (s *ScriptQuery) Source() string

func (*ScriptQuery) UnmarshalBSON

func (s *ScriptQuery) UnmarshalBSON(data []byte) error

func (*ScriptQuery) UnmarshalJSON

func (s *ScriptQuery) UnmarshalJSON(data []byte) error

type ScriptQueryParams

type ScriptQueryParams struct {
	// Name of the query (Optional)
	Name string
	// Script to run as a query. This script must return a boolean value, true or false. (Required)
	Lang   string
	Source string
	Params interface{}
}

ScriptQueryParams filters documents based on a provided script. The script query is typically used in a filter context.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html

func (ScriptQueryParams) Clause

func (s ScriptQueryParams) Clause() (QueryClause, error)

func (ScriptQueryParams) Kind

func (ScriptQueryParams) Script

func (s ScriptQueryParams) Script() (*ScriptQuery, error)

type ScriptScoreFunc

type ScriptScoreFunc struct {
	Filter CompleteClauser
	// float
	Weight interface{}
	Script *Script
}

func (ScriptScoreFunc) Function

func (ss ScriptScoreFunc) Function() (Function, error)

func (*ScriptScoreFunc) ScriptScore

func (ss *ScriptScoreFunc) ScriptScore() (*ScriptScoreFunction, error)

type ScriptScoreFunction

type ScriptScoreFunction struct {
	// contains filtered or unexported fields
}

func (*ScriptScoreFunction) DecodeParams

func (s *ScriptScoreFunction) DecodeParams(val interface{}) error

func (*ScriptScoreFunction) Filter

func (ss *ScriptScoreFunction) Filter() QueryClause

func (ScriptScoreFunction) FuncKind

func (ScriptScoreFunction) FuncKind() FuncKind

func (*ScriptScoreFunction) IsEmpty

func (s *ScriptScoreFunction) IsEmpty() bool

func (ScriptScoreFunction) Lang

func (s ScriptScoreFunction) Lang() string

func (ScriptScoreFunction) MarshalJSON

func (ss ScriptScoreFunction) MarshalJSON() ([]byte, error)

func (ScriptScoreFunction) Params

func (s ScriptScoreFunction) Params() dynamic.JSON

func (*ScriptScoreFunction) SetFilter

func (ss *ScriptScoreFunction) SetFilter(filter CompleteClauser) error

func (*ScriptScoreFunction) SetParams

func (s *ScriptScoreFunction) SetParams(params interface{}) error

func (*ScriptScoreFunction) SetScript

func (s *ScriptScoreFunction) SetScript(script *Script) error

func (*ScriptScoreFunction) SetWeight

func (b *ScriptScoreFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*ScriptScoreFunction) Source

func (s *ScriptScoreFunction) Source() string

func (*ScriptScoreFunction) Weight

func (b *ScriptScoreFunction) Weight() float64

type ScriptScoreQuery

type ScriptScoreQuery struct {
	// contains filtered or unexported fields
}

func (ScriptScoreQuery) Boost

func (b ScriptScoreQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*ScriptScoreQuery) Clause

func (s *ScriptScoreQuery) Clause() (QueryClause, error)

func (*ScriptScoreQuery) Clear

func (s *ScriptScoreQuery) Clear()

func (ScriptScoreQuery) Complete

func (ScriptScoreQuery) Complete()

func (*ScriptScoreQuery) DecodeParams

func (s *ScriptScoreQuery) DecodeParams(val interface{}) error

func (*ScriptScoreQuery) IsEmpty

func (s *ScriptScoreQuery) IsEmpty() bool

func (ScriptScoreQuery) Kind

func (ScriptScoreQuery) Kind() QueryKind

func (ScriptScoreQuery) Lang

func (s ScriptScoreQuery) Lang() string

func (ScriptScoreQuery) MarshalBSON

func (s ScriptScoreQuery) MarshalBSON() ([]byte, error)

func (ScriptScoreQuery) MarshalJSON

func (s ScriptScoreQuery) MarshalJSON() ([]byte, error)

func (ScriptScoreQuery) MinScore

func (ms ScriptScoreQuery) MinScore() float64

func (ScriptScoreQuery) Name

func (n ScriptScoreQuery) Name() string

func (ScriptScoreQuery) Params

func (s ScriptScoreQuery) Params() dynamic.JSON

func (*ScriptScoreQuery) Set

func (s *ScriptScoreQuery) Set(scriptScore *ScriptScoreQueryParams) error

Set sets the ScriptScoreQuery Options include:

  • picker.ScriptScoreQuery

func (*ScriptScoreQuery) SetBoost

func (b *ScriptScoreQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*ScriptScoreQuery) SetMinScore

func (ms *ScriptScoreQuery) SetMinScore(v float64)

func (*ScriptScoreQuery) SetName

func (n *ScriptScoreQuery) SetName(name string)

func (*ScriptScoreQuery) SetParams

func (s *ScriptScoreQuery) SetParams(params interface{}) error

func (*ScriptScoreQuery) SetScript

func (s *ScriptScoreQuery) SetScript(script *Script) error

func (*ScriptScoreQuery) Source

func (s *ScriptScoreQuery) Source() string

func (*ScriptScoreQuery) UnmarshalBSON

func (s *ScriptScoreQuery) UnmarshalBSON(data []byte) error

func (*ScriptScoreQuery) UnmarshalJSON

func (s *ScriptScoreQuery) UnmarshalJSON(data []byte) error

type ScriptScoreQueryParams

type ScriptScoreQueryParams struct {
	// Query used to return documents. (Required)
	Query *QueryParams
	// Documents with a score lower than this floating point number are excluded
	// from the search results. (Optional)
	MinScore float64
	// Documents scores produced by script are multiplied by boost to produce
	// final documents' scores. Defaults to 1.0. (Optional)
	Boost  interface{}
	Name   string
	Script *Script
}

ScriptScoreQueryParams uses a script to provide a custom score for returned documents.

The script_score query is useful if, for example, a scoring function is expensive and you only need to calculate the score of a filtered set of documents.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html

func (ScriptScoreQueryParams) Clause

func (ScriptScoreQueryParams) Kind

func (ScriptScoreQueryParams) ScriptScore

func (s ScriptScoreQueryParams) ScriptScore() (*ScriptScoreQuery, error)

type ScriptScorer

type ScriptScorer interface {
	ScriptScore() (*ScriptScoreQuery, error)
}

type Scripter

type Scripter interface {
	Script() (*ScriptQuery, error)
}
type Search struct {
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(p SearchParams) (*Search, error)

func (Search) DocValueFields

func (s Search) DocValueFields() SearchFields

DocValueFields is used to return return doc values for one or more fields in the search response.

(Optional, array of strings and objects) Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

You can specify items in the array as a string or object.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#docvalue-fields

func (Search) Encode

func (s Search) Encode() (*bytes.Buffer, error)

func (Search) Explain

func (s Search) Explain() bool

Explain indicates whether the search returns detailed information about score computation as part of a hit. Defaults to false.

func (*Search) Fields

func (s *Search) Fields() SearchFields

Fields allows for retrieving a list of document fields in the search response. It consults both the document _source and the index mappings to return each value in a standardized way that matches its mapping type. By default, date fields are formatted according to the date format parameter in their mappings. You can also use the fields parameter to retrieve runtime field values.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-param

func (Search) From

func (s Search) From() int

From sets the starting document offset. Defaults to 0.

By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

func (*Search) IndicesBoost

func (s *Search) IndicesBoost() map[string]float64

IndicesBoost buusts the _score of documents from specified indices

func (Search) MarshalBSON

func (s Search) MarshalBSON() ([]byte, error)

func (Search) MarshalJSON

func (s Search) MarshalJSON() ([]byte, error)

func (*Search) MinScore

func (s *Search) MinScore() float64

MinScore is the minimum _score for matching documents. Documents with a lower _score are not included in the search results.

func (Search) PITID

func (s Search) PITID() string

func (Search) PITKeepAlive

func (s Search) PITKeepAlive() *time.Time

func (Search) PointInTime

func (s Search) PointInTime() *PointInTime

PointInTime is a lightweight view into the state of the data as it existed when initiated

https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html

func (Search) PointInTimeID

func (s Search) PointInTimeID() string

func (Search) PointInTimeKeepAlive

func (s Search) PointInTimeKeepAlive() *time.Time

func (*Search) Query

func (s *Search) Query() *Query

Query defines the search definition using the Query DSL.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html

func (Search) RuntimeMappings

func (s Search) RuntimeMappings() RuntimeMappings

func (*Search) SetDocValueFields

func (s *Search) SetDocValueFields(v SearchFields) *Search

SetDocValueFields sets DocValueFieldsValue to v

func (*Search) SetExplain

func (s *Search) SetExplain(v bool)

SetExplain sets the ExplainValue to v

func (*Search) SetFields

func (s *Search) SetFields(v SearchFields)

SetFields sets the FieldsValue to v

func (*Search) SetFrom

func (s *Search) SetFrom(v int)

SetFrom sets the FromValue to v

func (*Search) SetIndicesBoost

func (s *Search) SetIndicesBoost(v map[string]float64)

SetIndicesBoost sets IndicesBoostValue to v

func (*Search) SetMinScore

func (s *Search) SetMinScore(v float64)

SetMinScore sets the MinScoreValue to v

func (*Search) SetPointInTime

func (s *Search) SetPointInTime(v *PointInTime)

SetPointInTime sets the PointInTimeValue to v

func (*Search) SetQuery

func (s *Search) SetQuery(v Querier) error

SetQuery sets QueryValue to v

func (*Search) SetRuntimeMappings

func (s *Search) SetRuntimeMappings(v RuntimeMappings)

func (*Search) SetSeqNoPrimaryTerm

func (s *Search) SetSeqNoPrimaryTerm(v bool)

func (*Search) SetSize

func (s *Search) SetSize(v int) error

func (*Search) SetSource

func (s *Search) SetSource(v interface{}) error

SetSource sets the value of Source

func (*Search) SetStats

func (s *Search) SetStats(v []string)

func (*Search) SetTerminateAfter

func (s *Search) SetTerminateAfter(v int)

func (*Search) SetTimeout

func (s *Search) SetTimeout(v time.Duration) *Search

func (*Search) SetVersion

func (s *Search) SetVersion(v bool) *Search

func (Search) Size

func (s Search) Size() int

Size is number of hits to return. Defaults to 10.

By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

func (Search) Source

func (s Search) Source() interface{}

Source indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. Defaults to true.

func (Search) Stats

func (s Search) Stats() []string

Stats groups to associate with the picker. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API (Optional).

func (Search) TerminateAfter

func (s Search) TerminateAfter() int

TerminateAfter is maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

Defaults to 0, which does not terminate query execution early.

func (Search) Timeout

func (s Search) Timeout() time.Duration

Timeout specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

func (*Search) UnmarshalBSON

func (s *Search) UnmarshalBSON(data []byte) error

func (*Search) UnmarshalJSON

func (s *Search) UnmarshalJSON(data []byte) (err error)

func (Search) Version

func (s Search) Version() bool

Version determines whether the document version should be returned as part a hit. Default: false

type SearchAsYouTypeField

type SearchAsYouTypeField struct {
	// contains filtered or unexported fields
}

SearchAsYouTypeField is a text-like field that is optimized to provide out-of-the-box support for queries that serve an as-you-type completion use case. It creates a series of subfields that are analyzed to index terms that can be efficiently matched by a query that partially matches the entire indexed text value. Both prefix completion (i.e matching terms starting at the beginning of the input) and infix completion (i.e. matching terms at any position within the input) are supported.

The size of shingles in subfields can be configured with the max_shingle_size mapping parameter. The default is 3, and valid values for this parameter are integer values 2 - 4 inclusive. Shingle subfields will be created for each shingle size from 2 up to and including the max_shingle_size. The my_field._index_prefix subfield will always use the analyzer from the shingle subfield with the max_shingle_size when constructing its own analyzer.

Increasing the max_shingle_size will improve matches for queries with more consecutive terms, at the cost of larger index size. The default max_shingle_size should usually be sufficient.

The same input text is indexed into each of these fields automatically, with their differing analysis chains, when an indexed document has a value for the root field my_field.

The most efficient way of querying to serve a search-as-you-type use case is usually a multi_match query of type bool_prefix that targets the root search_as_you_type field and its shingle subfields. This can match the query terms in any order, but will score documents higher if they contain the terms in order in a shingle subfield.

To search for documents that strictly match the query terms in order, or to search using other properties of phrase queries, use a match_phrase_prefix query on the root field. A match_phrase query can also be used if the last term should be matched exactly, and not as a prefix. Using phrase queries may be less efficient than using the match_bool_prefix query.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-as-you-type.html

func NewSearchAsYouTypeField

func NewSearchAsYouTypeField(params SearchAsYouTypeFieldParams) (*SearchAsYouTypeField, error)

func (SearchAsYouTypeField) Analyzer

func (ap SearchAsYouTypeField) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (*SearchAsYouTypeField) Field

func (s *SearchAsYouTypeField) Field() (Field, error)

func (SearchAsYouTypeField) Index

func (i SearchAsYouTypeField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (SearchAsYouTypeField) IndexOptions

func (io SearchAsYouTypeField) IndexOptions() IndexOptions

IndexOptions parameter controls what information is added to the inverted index for search and highlighting purposes.

func (SearchAsYouTypeField) MarshalBSON

func (s SearchAsYouTypeField) MarshalBSON() ([]byte, error)

func (SearchAsYouTypeField) MarshalJSON

func (s SearchAsYouTypeField) MarshalJSON() ([]byte, error)

func (SearchAsYouTypeField) MaxShingleSize

func (mss SearchAsYouTypeField) MaxShingleSize() int

MaxShingleSize is the largest shingle size to create. Valid values are 2 (inclusive) to 4 (inclusive). Defaults to 3.

func (SearchAsYouTypeField) Norms

func (n SearchAsYouTypeField) Norms() bool

Norms determines whether field-length should be taken into account when scoring queries. Accepts true (default) or false.

func (SearchAsYouTypeField) SearchAnalyzer

func (sa SearchAsYouTypeField) SearchAnalyzer() string

SearchAnalyzer overrides Analyzer for search analysis

func (SearchAsYouTypeField) SearchQuoteAnalyzer

func (sq SearchAsYouTypeField) SearchQuoteAnalyzer() string

SearchQuoteAnalyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

func (*SearchAsYouTypeField) SetAnalyzer

func (ap *SearchAsYouTypeField) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*SearchAsYouTypeField) SetIndex

func (i *SearchAsYouTypeField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*SearchAsYouTypeField) SetIndexOptions

func (io *SearchAsYouTypeField) SetIndexOptions(v IndexOptions) error

SetIndexOptions sets IndexOptions value to v

func (*SearchAsYouTypeField) SetMaxShingleSize

func (mss *SearchAsYouTypeField) SetMaxShingleSize(v int) error

SetMaxShingleSize sets the MaxShingleSize to v

Valid values are 2 (inclusive) to 4 (inclusive). Defaults to 3.

func (*SearchAsYouTypeField) SetNorms

func (n *SearchAsYouTypeField) SetNorms(v interface{}) error

SetNorms sets the Norms value to v

func (*SearchAsYouTypeField) SetSearchAnalyzer

func (sa *SearchAsYouTypeField) SetSearchAnalyzer(v string)

SetSearchAnalyzer sets search_analyzer to v

func (SearchAsYouTypeField) SetSearchQuoteAnalyzer

func (sq SearchAsYouTypeField) SetSearchQuoteAnalyzer(v string)

SetSearchQuoteAnalyzer sets search_quote_analyzer to v

func (*SearchAsYouTypeField) SetSimilarity

func (s *SearchAsYouTypeField) SetSimilarity(v Similarity) error

SetSimilarity sets the Similarity Value to v

func (*SearchAsYouTypeField) SetStore

func (sa *SearchAsYouTypeField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (*SearchAsYouTypeField) SetTermVector

func (tv *SearchAsYouTypeField) SetTermVector(v TermVector) error

SetTermVector sets the TermVector Value to v

func (SearchAsYouTypeField) Similarity

func (s SearchAsYouTypeField) Similarity() Similarity

Similarity is mostly useful for text fields, but can also apply to other field types.

func (SearchAsYouTypeField) Store

func (sa SearchAsYouTypeField) Store() bool

Store returns the StoreAttr Value or false

func (SearchAsYouTypeField) TermVector

func (tv SearchAsYouTypeField) TermVector() TermVector

TermVector determines whether term vectors should be stored for the field. Defaults to "no" / TermVectorNone.

func (SearchAsYouTypeField) Type

func (*SearchAsYouTypeField) UnmarshalBSON

func (s *SearchAsYouTypeField) UnmarshalBSON(data []byte) error

func (*SearchAsYouTypeField) UnmarshalJSON

func (s *SearchAsYouTypeField) UnmarshalJSON(data []byte) error

type SearchAsYouTypeFieldParams

type SearchAsYouTypeFieldParams struct {
	// (Optional, integer) Largest shingle size to create. Valid values are 2
	// (inclusive) to 4 (inclusive). Defaults to 3.
	MaxShingleSize int `json:"max_shingle_size,omitempty"`

	// The analyzer which should be used for the text field, both at index-time
	// and at search-time (unless overridden by the search_analyzer). Defaults
	// to the default index analyzer, or the standard analyzer.
	Analyzer string `json:"analyzer,omitempty"`

	// Should the field be searchable? Accepts true (default) or false.
	Index interface{} `json:"index,omitempty"`

	// What information should be stored in the index, for search and
	// highlighting purposes. Defaults to positions
	IndexOptions IndexOptions `json:"index_options,omitempty"`

	// Whether field-length should be taken into account when scoring queries.
	// Accepts true (default) or false.
	Norms interface{} `json:"norms,omitempty"`

	// Whether the field value should be stored and retrievable separately from
	// the _source field. Accepts true or false (default).
	Store interface{} `json:"store,omitempty"`

	// The analyzer that should be used at search time on the text field. Defaults to the analyzer setting.
	SearchAnalyzer string `json:"search_analyzer,omitempty"`

	// The analyzer that should be used at search time when a phrase is
	// encountered. Defaults to the search_analyzer setting.
	SearchQuoteAnalyzer string `json:"search_quote_analyzer,omitempty"`

	// Which scoring algorithm or similarity should be used. Defaults to BM25.
	Similarity Similarity `json:"similarity,omitempty"`

	// Whether term vectors should be stored for the field. Defaults to no. This
	// option configures the root field and shingle subfields, but not the
	// prefix subfield.
	TermVector TermVector `json:"term_vector,omitempty"`
}

func (SearchAsYouTypeFieldParams) Field

func (p SearchAsYouTypeFieldParams) Field() (Field, error)

func (SearchAsYouTypeFieldParams) SearchAsYouType

func (p SearchAsYouTypeFieldParams) SearchAsYouType() (*SearchAsYouTypeField, error)

func (SearchAsYouTypeFieldParams) Type

type SearchField

type SearchField struct {
	// Wildcard pattern. The request returns doc values for
	// field names matching this pattern. (Required)
	Field string

	//  Format in which the doc values are returned.
	//
	// For date fields, you can specify a date date format. For numeric fields
	// fields, you can specify a DecimalFormat pattern. (Optional)
	//
	// For other field data types, this parameter is not supported.
	Format string
}

func (SearchField) MarshalBSON

func (f SearchField) MarshalBSON() ([]byte, error)

func (SearchField) MarshalJSON

func (f SearchField) MarshalJSON() ([]byte, error)

func (*SearchField) UnmarshalBSON

func (f *SearchField) UnmarshalBSON(data []byte) error

func (*SearchField) UnmarshalJSON

func (f *SearchField) UnmarshalJSON(data []byte) error

type SearchFields

type SearchFields []SearchField

SearchFields allows for retrieving a list of document fields in the search response. It consults both the document _source and the index mappings to return each value in a standardized way that matches its mapping type. By default, date fields are formatted according to the date format parameter in their mappings. You can also use the fields parameter to retrieve runtime field values.

(Optional, array of strings and objects) Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

You can specify items in the array as a string or object. See Fields for more details.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-param

type SearchParams

type SearchParams struct {
	Query        Querier
	Sort         Sort
	Aggregations map[string]interface{}
	// Array of wildcard (*) patterns. The request returns doc values for field
	// names matching these patterns in the hits.fields property of the response
	// (Optional) .
	//
	// You can specify items in the array as a string or object.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#docvalue-fields
	//
	// See also:
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
	DocValueFields SearchFields

	// Array of wildcard (*) patterns. The request returns values for field
	// names matching these patterns in the hits.fields property of the response
	// (Optional).
	//
	// You can specify items in the array as a string or object.
	Fields SearchFields

	// If true, returns detailed information about score computation as part of
	// a hit. Defaults to false. (Optional)
	Explain bool

	// Starting document offset. Defaults to 0.
	//
	// By default, you cannot page through more than 10,000 hits using the from
	// and size parameters. To page through more hits, use the search_after
	// parameter. (Optional)
	From int

	// Boosts the _score of documents from specified indices (Optional).
	IndicesBoost map[string]float64

	// Minimum _score for matching documents. Documents with a lower _score are
	// not included in the search results (Optional).
	MinScore float64

	// Limits the search to a point in time (PIT). If you provide a pit, you
	// cannot specify a <target> in the request path. (Optional)
	PointInTime *PointInTime

	//  Defines a runtime field in the search request that exist only as part of
	//  the query. Fields defined in the search request take precedence over
	//  fields defined with the same name in the index mappings. (Optional)
	RuntimeMappings RuntimeMappings

	// If true, returns sequence number and primary term of the last
	// modification of each hit. See Optimistic concurrency control. (Optional)
	SeqNoPrimaryTerm bool

	// The number of hits to return. Defaults to 10. (Optional)
	//
	// By default, you cannot page through more than 10,000 hits using the from
	// and size parameters. To page through more hits, use the search_after
	// parameter.
	Size int

	// Indicates which source fields are returned for matching documents. These
	// fields are returned in the hits._source property of the search response.
	// Defaults to true. (Optional)
	Source interface{}

	// Stats groups to associate with the picker. Each group maintains a
	// statistics aggregation for its associated searches. You can retrieve
	// these stats using the indices stats API (Optional).
	Stats []string

	// The maximum number of documents to collect for each shard, upon reaching
	// which the query execution will terminate early. (Optional)
	//
	// Defaults to 0, which does not terminate query execution early.
	TerminateAfter int

	// Specifies the period of time to wait for a response. If no response is
	// received before the timeout expires, the request fails and returns an
	// error. Defaults to no timeout. (Optional)
	Timeout time.Duration

	// If true, returns document version as part of a hit. Defaults to false. (Optional)
	Version bool

	Highlight interface{}
}

SearchParams are the initial params passed to NewSearch

type SearchSource

type SearchSource struct {
	// contains filtered or unexported fields
}

func (*SearchSource) SetValue

func (s *SearchSource) SetValue(v interface{}) error

SetValue sets the value of Source

The options are:

string
[]string
dynamic.StringOrArrayOfStrings
*dynamic.StringOrArrayOfStrings
SourceSpecifications
*SourceSpecifications
bool
*bool
nil

SetValue returns an error if v is not one of the types listed above.

func (SearchSource) Value

func (s SearchSource) Value() interface{}

Value indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. Defaults to true.

type SearchSourceParams

type SearchSourceParams struct{}

type Shape

type Shape struct {
	Coordinates interface{} `json:"coordinates"`
	Type        string      `json:"type"`
}

type ShapeField

type ShapeField struct {
	// contains filtered or unexported fields
}

ShapeField facilitates the indexing of and searching with arbitrary geo shapes such as rectangles and polygons. It should be used when either the data being indexed or the queries being executed contain shapes other than just points.

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html

func NewShapeField

func NewShapeField(params ShapeFieldParams) (*ShapeField, error)

func (*ShapeField) Field

func (gs *ShapeField) Field() (Field, error)

func (ShapeField) IgnoreMalformed

func (im ShapeField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (ShapeField) IgnoreZValue

func (z ShapeField) IgnoreZValue() bool

IgnoreZValue determines whether three dimension points will be indexed.

If true (default) three dimension points will be accepted (stored in source) but only latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points containing any more than latitude and longitude (two dimensions) values throw an exception and reject the whole document.

func (ShapeField) MarshalJSON

func (gs ShapeField) MarshalJSON() ([]byte, error)

func (ShapeField) NullValue

func (nv ShapeField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (ShapeField) Orientation

func (o ShapeField) Orientation() Orientation

Orientation is the vertex order for the shape’s coordinates list.

Defaults to OrientationRight (RIGHT) to comply with OGC standards. OGC standards define outer ring vertices in counterclockwise order with inner ring (hole) vertices in clockwise order.

func (*ShapeField) SetIgnoreMalformed

func (im *ShapeField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*ShapeField) SetIgnoreZValue

func (z *ShapeField) SetIgnoreZValue(v interface{}) error

SetIgnoreZValue sets the IgnoreZValue Value to v

func (*ShapeField) SetNullValue

func (nv *ShapeField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*ShapeField) SetOrientation

func (o *ShapeField) SetOrientation(orientation Orientation) error

SetOrientation sets the Orientation Value to v

func (ShapeField) Type

func (ShapeField) Type() FieldType

func (*ShapeField) UnmarshalJSON

func (gs *ShapeField) UnmarshalJSON(data []byte) error

type ShapeFieldParams

type ShapeFieldParams struct {
	// Optionally define how to interpret vertex order for polygons /
	// multipolygons. This parameter defines one of two coordinate system rules
	// (Right-hand or Left-hand) each of which can be specified in three
	// different ways. 1. Right-hand rule: right, ccw, counterclockwise, 2.
	// Left-hand rule: left, cw, clockwise. The default orientation
	// (counterclockwise) complies with the OGC standard which defines outer
	// ring vertices in counterclockwise order with inner ring(s) vertices
	// (holes) in clockwise order. Setting this parameter in the geo_shape
	// mapping explicitly sets vertex order for the coordinate list of a
	// geo_shape field but can be overridden in each individual GeoJSON or WKT
	// document.
	Orientation Orientation `json:"orientation,omitempty"`

	// If true, malformed GeoJSON or WKT shapes are ignored. If false (default),
	// malformed GeoJSON and WKT shapes throw an exception and reject the entire
	// document.
	IgnoreMalformed interface{} `json:"ignore_malformed,omitempty"`
	// If true (default) three dimension points will be accepted (stored in
	// source) but only latitude and longitude values will be indexed; the third
	// dimension is ignored. If false, geo-points containing any more than
	// latitude and longitude (two dimensions) values throw an exception and
	// reject the whole document.
	IgnoreZValue interface{} `json:"ignore_z_value,omitempty"`
}

func (ShapeFieldParams) Field

func (p ShapeFieldParams) Field() (Field, error)

func (ShapeFieldParams) Shape

func (p ShapeFieldParams) Shape() (*ShapeField, error)

func (ShapeFieldParams) Type

func (ShapeFieldParams) Type() FieldType

type ShapeQuerier

type ShapeQuerier interface {
	ShapeQuery() (*ShapeQuery, error)
}

type ShapeQuery

type ShapeQuery struct {
	// contains filtered or unexported fields
}

func (*ShapeQuery) Clause

func (q *ShapeQuery) Clause() (QueryClause, error)

func (*ShapeQuery) Clear

func (q *ShapeQuery) Clear()

func (ShapeQuery) Complete

func (ShapeQuery) Complete()

func (ShapeQuery) Field

func (f ShapeQuery) Field() string

func (ShapeQuery) IgnoreUnmapped

func (q ShapeQuery) IgnoreUnmapped() bool

func (*ShapeQuery) IsEmpty

func (q *ShapeQuery) IsEmpty() bool

func (ShapeQuery) Kind

func (ShapeQuery) Kind() QueryKind

func (ShapeQuery) MarshalBSON

func (q ShapeQuery) MarshalBSON() ([]byte, error)

func (ShapeQuery) MarshalJSON

func (q ShapeQuery) MarshalJSON() ([]byte, error)

func (ShapeQuery) Name

func (n ShapeQuery) Name() string

func (ShapeQuery) Relation

func (q ShapeQuery) Relation() SpatialRelation

func (*ShapeQuery) SetField

func (f *ShapeQuery) SetField(field string) error

func (*ShapeQuery) SetIgnoreUnmapped

func (q *ShapeQuery) SetIgnoreUnmapped(v bool)

func (*ShapeQuery) SetIndexedShape

func (q *ShapeQuery) SetIndexedShape(indexed *IndexedShape) error

func (*ShapeQuery) SetName

func (n *ShapeQuery) SetName(name string)

func (*ShapeQuery) SetRelation

func (q *ShapeQuery) SetRelation(v SpatialRelation) error

func (*ShapeQuery) SetShape

func (q *ShapeQuery) SetShape(shape interface{}) error

func (ShapeQuery) Shape

func (q ShapeQuery) Shape() interface{}

func (*ShapeQuery) ShapeQuery

func (q *ShapeQuery) ShapeQuery() (*ShapeQuery, error)

func (*ShapeQuery) UnmarshalBSON

func (q *ShapeQuery) UnmarshalBSON(data []byte) error

func (*ShapeQuery) UnmarshalJSON

func (q *ShapeQuery) UnmarshalJSON(data []byte) error

type ShapeQueryParams

type ShapeQueryParams struct {
	Field          string
	Name           string
	Relation       SpatialRelation
	Shape          interface{}
	IndexedShape   *IndexedShape
	IgnoreUnmapped bool
	// contains filtered or unexported fields
}

func (ShapeQueryParams) Clause

func (p ShapeQueryParams) Clause() (QueryClause, error)

func (ShapeQueryParams) Complete

func (ShapeQueryParams) Complete()

func (ShapeQueryParams) Kind

func (ShapeQueryParams) Kind() QueryKind

func (ShapeQueryParams) ShapeQuery

func (p ShapeQueryParams) ShapeQuery() (*ShapeQuery, error)

type ShortField

type ShortField struct {
	// contains filtered or unexported fields
}

A ShortField is signed 16-bit integer with a minimum value of -32,768 and a maximum value of 32,767.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewShortField

func NewShortField(params ShortFieldParams) (*ShortField, error)

func (ShortField) Boost

func (b ShortField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (ShortField) Coerce

func (cp ShortField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (ShortField) DocValues

func (dv ShortField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*ShortField) Field

func (s *ShortField) Field() (Field, error)

func (ShortField) IgnoreMalformed

func (im ShortField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (ShortField) Index

func (i ShortField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (ShortField) MarshalBSON

func (s ShortField) MarshalBSON() ([]byte, error)

func (ShortField) MarshalJSON

func (s ShortField) MarshalJSON() ([]byte, error)

func (ShortField) Meta

func (m ShortField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (ShortField) NullValue

func (nv ShortField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*ShortField) SetBoost

func (b *ShortField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*ShortField) SetCoerce

func (cp *ShortField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*ShortField) SetDocValues

func (dv *ShortField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*ShortField) SetIgnoreMalformed

func (im *ShortField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*ShortField) SetIndex

func (i *ShortField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*ShortField) SetMeta

func (m *ShortField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*ShortField) SetNullValue

func (nv *ShortField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*ShortField) SetStore

func (sa *ShortField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (ShortField) Store

func (sa ShortField) Store() bool

Store returns the StoreAttr Value or false

func (ShortField) Type

func (ShortField) Type() FieldType

func (*ShortField) UnmarshalBSON

func (s *ShortField) UnmarshalBSON(data []byte) error

func (*ShortField) UnmarshalJSON

func (s *ShortField) UnmarshalJSON(data []byte) error

type ShortFieldParams

type ShortFieldParams numberFieldParams

func (ShortFieldParams) Field

func (p ShortFieldParams) Field() (Field, error)

func (ShortFieldParams) Short

func (p ShortFieldParams) Short() (*ShortField, error)

func (ShortFieldParams) Type

func (ShortFieldParams) Type() FieldType

type SigmoidFunction

type SigmoidFunction struct {
	// contains filtered or unexported fields
}

func (SigmoidFunction) Exponent

func (s SigmoidFunction) Exponent() float64

func (SigmoidFunction) MarshalBSON

func (s SigmoidFunction) MarshalBSON() ([]byte, error)

func (SigmoidFunction) MarshalJSON

func (s SigmoidFunction) MarshalJSON() ([]byte, error)

func (SigmoidFunction) Pivot

func (s SigmoidFunction) Pivot() float64

func (*SigmoidFunction) SetExponent

func (s *SigmoidFunction) SetExponent(exponent interface{}) error

func (*SigmoidFunction) SetPivot

func (s *SigmoidFunction) SetPivot(pivot interface{}) error

func (*SigmoidFunction) Sigmoid

func (s *SigmoidFunction) Sigmoid() (*SigmoidFunction, error)

func (*SigmoidFunction) UnmarshalBSON

func (s *SigmoidFunction) UnmarshalBSON(data []byte) error

func (*SigmoidFunction) UnmarshalJSON

func (s *SigmoidFunction) UnmarshalJSON(data []byte) error

type SigmoidFunctionParams

type SigmoidFunctionParams struct {
	Pivot    interface{}
	Exponent interface{}
}

func (SigmoidFunctionParams) Sigmoid

type SigmoidFunctioner

type SigmoidFunctioner interface {
	Sigmoid() (*SigmoidFunction, error)
}

type Similarity

type Similarity string

Similarity is mostly useful for text fields, but can also apply to other field types.

const (
	// The Okapi BM25 algorithm. The algorithm used by default in Elasticsearch and Lucene.
	//
	// https://en.wikipedia.org/wiki/Okapi_BM25
	SimilarityBM25 Similarity = "BM25"
	// SimilarityClassic is the former default in ElasticSsearch and Lucene that has since been deprecated
	//
	// Deprecated: TF/IDF algorithm, the former default in Elasticsearch and Lucene.
	SimilarityClassic Similarity = "classic"

	// SimilarityBoolean is a simple boolean similarity, which is used when
	// full-text ranking is not needed and the score should only be based on
	// whether the query terms match or not. Boolean similarity gives terms a
	// score equal to their query boost.
	SimilarityBoolean Similarity = "boolean"
)

func (Similarity) String

func (s Similarity) String() string

type SimpleQueryStringQuery

type SimpleQueryStringQuery struct {
	// contains filtered or unexported fields
}

func (SimpleQueryStringQuery) AnalyzeWildcard

func (cp SimpleQueryStringQuery) AnalyzeWildcard() bool

If true, the query attempts to analyze wildcard terms in the query string. Defaults to false.

func (SimpleQueryStringQuery) Analyzer

func (ap SimpleQueryStringQuery) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (SimpleQueryStringQuery) AutoGenerateSynonymsPhraseQuery

func (a SimpleQueryStringQuery) AutoGenerateSynonymsPhraseQuery() bool

AutoGenerateSynonymsPhraseQuery determines if match phrase queries are automatically created for multi-term synonyms. Defaults to true.

func (SimpleQueryStringQuery) Boost

func (b SimpleQueryStringQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*SimpleQueryStringQuery) Clause

func (qs *SimpleQueryStringQuery) Clause() (QueryClause, error)

func (*SimpleQueryStringQuery) Clear

func (qs *SimpleQueryStringQuery) Clear()

func (SimpleQueryStringQuery) Complete

func (SimpleQueryStringQuery) Complete()

func (SimpleQueryStringQuery) DefaultOperator

func (o SimpleQueryStringQuery) DefaultOperator() Operator

func (SimpleQueryStringQuery) Fields

func (qs SimpleQueryStringQuery) Fields() []string

func (SimpleQueryStringQuery) Flags

func (qs SimpleQueryStringQuery) Flags() string

func (SimpleQueryStringQuery) FuzzyMaxExpansions

func (me SimpleQueryStringQuery) FuzzyMaxExpansions() int

FuzzyMaxExpansions is the maximum number of variations created. Defaults to 50.

func (SimpleQueryStringQuery) FuzzyPrefixLength

func (me SimpleQueryStringQuery) FuzzyPrefixLength() int

func (SimpleQueryStringQuery) FuzzyTranspositions

func (ft SimpleQueryStringQuery) FuzzyTranspositions() bool

FuzzyTranspositions edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

func (*SimpleQueryStringQuery) IsEmpty

func (qs *SimpleQueryStringQuery) IsEmpty() bool

func (SimpleQueryStringQuery) Kind

func (SimpleQueryStringQuery) Lenient

func (l SimpleQueryStringQuery) Lenient() bool

Lenient determines whether format-based errors, such as providing a text query value for a numeric field, are ignored. Defaults to false.

func (SimpleQueryStringQuery) MarshalJSON

func (qs SimpleQueryStringQuery) MarshalJSON() ([]byte, error)

func (SimpleQueryStringQuery) MaxDeterminizedStates

func (mds SimpleQueryStringQuery) MaxDeterminizedStates() int

func (SimpleQueryStringQuery) MinimumShouldMatch

func (msm SimpleQueryStringQuery) MinimumShouldMatch() string

func (SimpleQueryStringQuery) Name

func (n SimpleQueryStringQuery) Name() string

func (SimpleQueryStringQuery) PhraseSlop

func (mds SimpleQueryStringQuery) PhraseSlop() int

func (SimpleQueryStringQuery) Query

func (qs SimpleQueryStringQuery) Query() string

func (SimpleQueryStringQuery) QuoteAnalyzer

func (sq SimpleQueryStringQuery) QuoteAnalyzer() string

QuoteAnalyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

func (SimpleQueryStringQuery) QuoteFieldSuffix

func (qf SimpleQueryStringQuery) QuoteFieldSuffix() string

func (*SimpleQueryStringQuery) SetAnalyzeWildcard

func (cp *SimpleQueryStringQuery) SetAnalyzeWildcard(v interface{}) error

SetAnalyzeWildcard sets analyze_wildcard to v

func (*SimpleQueryStringQuery) SetAnalyzer

func (ap *SimpleQueryStringQuery) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*SimpleQueryStringQuery) SetAutoGenerateSynonymsPhraseQuery

func (a *SimpleQueryStringQuery) SetAutoGenerateSynonymsPhraseQuery(v interface{}) error

SetAutoGenerateSynonymsPhraseQuery sets AutoGenerateSynonymsPhraseQueryValue to v

func (*SimpleQueryStringQuery) SetBoost

func (b *SimpleQueryStringQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*SimpleQueryStringQuery) SetDefaultOperator

func (o *SimpleQueryStringQuery) SetDefaultOperator(v Operator) error

func (*SimpleQueryStringQuery) SetFields

func (qs *SimpleQueryStringQuery) SetFields(fields []string)

func (*SimpleQueryStringQuery) SetFlags

func (qs *SimpleQueryStringQuery) SetFlags(field string)

func (*SimpleQueryStringQuery) SetFuzzyMaxExpansions

func (me *SimpleQueryStringQuery) SetFuzzyMaxExpansions(v interface{}) error

func (*SimpleQueryStringQuery) SetFuzzyPrefixLength

func (me *SimpleQueryStringQuery) SetFuzzyPrefixLength(v interface{}) error

func (*SimpleQueryStringQuery) SetFuzzyTranspositions

func (ft *SimpleQueryStringQuery) SetFuzzyTranspositions(fuzzyTranspositions interface{}) error

SetFuzzyTranspositions sets FuzzyTranspositions to v

func (*SimpleQueryStringQuery) SetLenient

func (l *SimpleQueryStringQuery) SetLenient(v bool)

SetLenient sets Lenient to v

func (*SimpleQueryStringQuery) SetMaxDeterminizedStates

func (mds *SimpleQueryStringQuery) SetMaxDeterminizedStates(v interface{}) error

func (*SimpleQueryStringQuery) SetMinimumShouldMatch

func (msm *SimpleQueryStringQuery) SetMinimumShouldMatch(v string)

func (*SimpleQueryStringQuery) SetName

func (n *SimpleQueryStringQuery) SetName(name string)

func (*SimpleQueryStringQuery) SetPhraseSlop

func (mds *SimpleQueryStringQuery) SetPhraseSlop(v interface{}) error

func (*SimpleQueryStringQuery) SetQuery

func (qs *SimpleQueryStringQuery) SetQuery(q string) error

func (SimpleQueryStringQuery) SetQuoteAnalyzer

func (sq SimpleQueryStringQuery) SetQuoteAnalyzer(v string)

SetQuoteAnalyzer sets search_quote_analyzer to v

func (*SimpleQueryStringQuery) SetQuoteFieldSuffix

func (qf *SimpleQueryStringQuery) SetQuoteFieldSuffix(quoteFieldSuffix string)

func (*SimpleQueryStringQuery) SimpleQueryString

func (qs *SimpleQueryStringQuery) SimpleQueryString() (*SimpleQueryStringQuery, error)

func (*SimpleQueryStringQuery) UnmarshalJSON

func (qs *SimpleQueryStringQuery) UnmarshalJSON(data []byte) error

type SimpleQueryStringQueryParams

type SimpleQueryStringQueryParams struct {
	// (Required, string) Query string you wish to parse and use for search. See
	// Query string syntax.
	Query string `json:"query"`
	// (Optional, string) List of enabled operators for the simple query string
	// syntax. Defaults to ALL (all operators).
	Flags string `json:"flags,omitempty"`

	// (Optional, Boolean) If true, the query attempts to analyze wildcard terms
	// in the query string. Defaults to false.
	AnalyzeWildcard interface{} `json:"analyze_wildcard,omitempty"`
	// (Optional, string) Analyzer used to convert text in the query string into
	// tokens. Defaults to the index-time analyzer mapped for the default_field.
	// If no analyzer is mapped, the index’s default analyzer is used.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional, Boolean) If true, match phrase queries are automatically
	// created for multi-term synonyms. Defaults to true.
	AutoGenerateSynonymsPhraseQuery interface{} `json:"auto_generate_synonyms_phrase_query,omitempty"`
	// (Optional, float) Floating point number used to decrease or increase the
	// relevance scores of the query. Defaults to 1.0.
	//
	// Boost values are relative to the default value of 1.0. A boost value
	// between 0 and 1.0 decreases the relevance score. A value greater than 1.0
	// increases the relevance score.
	Boost interface{} `json:"boost,omitempty"`
	// (Optional, string) Default boolean logic used to interpret text in the
	// query string if no operators are specified. Valid values are:
	//
	// - OR (Default)
	//
	// - AND
	DefaultOperator Operator `json:"default_operator,omitempty"`

	// (Optional, array of strings) Array of fields you wish to search.
	//
	// You can use this parameter query to search across multiple fields. See
	// Search multiple fields.
	Fields []string `json:"fields,omitempty"`

	FuzzyPrefixLength interface{} `json:"fuzzy_prefix_length,omitempty"`
	// (Optional, integer) Maximum number of terms to which the query expands
	// for fuzzy matching. Defaults to 50.
	FuzzyMaxExpansions interface{} `json:"fuzzy_max_expansions,omitempty"`
	// (Optional, Boolean) If true, edits for fuzzy matching include
	// transpositions of two adjacent characters (ab → ba). Defaults to true.
	FuzzyTranspositions interface{} `json:"fuzzy_transpositions,omitempty"`
	// (Optional, Boolean) If true, format-based errors, such as providing a
	// text value for a numeric field, are ignored. Defaults to false.
	Lenient bool `json:"lenient,omitempty"`
	// (Optional, integer) Maximum number of automaton states required for the
	// query. Default is 10000.
	//
	// Elasticsearch uses Apache Lucene internally to parse regular expressions.
	// Lucene converts each regular expression to a finite automaton containing
	// a number of determinized states.
	//
	// You can use this parameter to prevent that conversion from
	// unintentionally consuming too many resources. You may need to increase
	// this limit to run complex regular expressions.
	MaxDeterminizedStates interface{} `json:"max_determinized_states,omitempty"`
	// (Optional, string) Minimum number of clauses that must match for a
	// document to be returned. See the minimum_should_match parameter for valid
	// values and more information. See How minimum_should_match works for an
	// example.
	MinimumShouldMatch string `json:"minimum_should_match,omitempty"`
	// (Optional, string) Analyzer used to convert quoted text in the query
	// string into tokens. Defaults to the search_quote_analyzer mapped for the
	// default_field.
	//
	// For quoted text, this parameter overrides the analyzer specified in the
	// analyzer parameter.
	QuoteAnalyzer string `json:"quote_analyzer,omitempty"`
	// (Optional, integer) Maximum number of positions allowed between matching
	// tokens for phrases. Defaults to 0. If 0, exact phrase matches are
	// required. Transposed terms have a slop of 2.
	PhraseSlop interface{} `json:"phrase_slop,omitempty"`
	// (Optional, string) Suffix appended to quoted text in the query string.
	//
	// You can use this suffix to use a different analysis method for exact
	// matches. See Mixing exact search with stemming.
	QuoteFieldSuffix string `json:"quote_field_suffix,omitempty"`
	Name             string `json:"_name,omitempty"`
	// contains filtered or unexported fields
}

func (SimpleQueryStringQueryParams) Clause

func (SimpleQueryStringQueryParams) Complete

func (SimpleQueryStringQueryParams) Complete()

func (SimpleQueryStringQueryParams) Kind

func (SimpleQueryStringQueryParams) SimpleQueryString

func (p SimpleQueryStringQueryParams) SimpleQueryString() (*SimpleQueryStringQuery, error)

type SimpleQueryStringer

type SimpleQueryStringer interface {
	SimpleQueryString() (*SimpleQueryStringQuery, error)
}

type Sort

type Sort []SortEntry

type SortEntry

type SortEntry struct {
	Field       string      `json:"-"`
	Order       SortOrder   `json:"order,omitempty"`
	Mode        SortMode    `json:"mode,omitempty"`
	NumericType string      `json:"numeric_type,omitempty"`
	Missing     string      `json:"missing,omitempty"`
	Type        string      `json:"type,omitempty"`
	Script      *Script     `json:"script,omitempty"`
	Nested      *SortNested `json:"nested,omitempty"`
}

func (SortEntry) MarshalJSON

func (s SortEntry) MarshalJSON() ([]byte, error)

func (*SortEntry) UnmarshalJSON

func (s *SortEntry) UnmarshalJSON(data []byte) error

type SortMode

type SortMode string

type SortNested

type SortNested struct {
	// A filter that the inner objects inside the nested path should match with
	// in order for its field values to be taken into account by sorting. Common
	// case is to repeat the query / filter inside the nested filter or query.
	// By default no nested_filter is active.
	Filter *Query `json:"filter,omitempty"`
	// Defines on which nested object to sort. The actual sort field must be a
	// direct field inside this nested object. When sorting by nested field,
	// this field is mandatory.
	Path string `json:"path,omitempty"`
	// Same as top-level nested but applies to another nested path within the
	// current nested object.
	Nested *SortNested `json:"nested,omitempty"`
	// The maximum number of children to consider per root document when picking
	// the sort value. Defaults to unlimited.
	MaxChildren int64 `json:"max_children,omitempty"`
}

type SortOrder

type SortOrder string

func (*SortOrder) IsValid

func (o *SortOrder) IsValid() bool

func (SortOrder) String

func (so SortOrder) String() string

type SourceSpecifications

type SourceSpecifications struct {
	Includes dynamic.StringOrArrayOfStrings
	Excludes dynamic.StringOrArrayOfStrings
}

type SpanContainingQuery

type SpanContainingQuery struct {
	// contains filtered or unexported fields
}

func (*SpanContainingQuery) Clause

func (q *SpanContainingQuery) Clause() (QueryClause, error)

func (*SpanContainingQuery) Clear

func (q *SpanContainingQuery) Clear()

func (SpanContainingQuery) Complete

func (SpanContainingQuery) Complete()

func (*SpanContainingQuery) IsEmpty

func (q *SpanContainingQuery) IsEmpty() bool

func (SpanContainingQuery) Kind

func (SpanContainingQuery) MarshalBSON

func (q SpanContainingQuery) MarshalBSON() ([]byte, error)

func (SpanContainingQuery) MarshalJSON

func (q SpanContainingQuery) MarshalJSON() ([]byte, error)

func (SpanContainingQuery) Name

func (n SpanContainingQuery) Name() string

func (*SpanContainingQuery) SetName

func (n *SpanContainingQuery) SetName(name string)

func (*SpanContainingQuery) SpanContaining

func (q *SpanContainingQuery) SpanContaining() (*SpanContainingQuery, error)

func (*SpanContainingQuery) UnmarshalBSON

func (q *SpanContainingQuery) UnmarshalBSON(data []byte) error

func (*SpanContainingQuery) UnmarshalJSON

func (q *SpanContainingQuery) UnmarshalJSON(data []byte) error

type SpanContainingQueryParams

type SpanContainingQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanContainingQueryParams) Clause

func (SpanContainingQueryParams) Complete

func (SpanContainingQueryParams) Complete()

func (SpanContainingQueryParams) Kind

func (SpanContainingQueryParams) SpanContaining

func (p SpanContainingQueryParams) SpanContaining() (*SpanContainingQuery, error)

type SpanFirstQuery

type SpanFirstQuery struct {
	// contains filtered or unexported fields
}

func (*SpanFirstQuery) Clause

func (q *SpanFirstQuery) Clause() (QueryClause, error)

func (*SpanFirstQuery) Clear

func (q *SpanFirstQuery) Clear()

func (SpanFirstQuery) Complete

func (SpanFirstQuery) Complete()

func (*SpanFirstQuery) IsEmpty

func (q *SpanFirstQuery) IsEmpty() bool

func (SpanFirstQuery) Kind

func (SpanFirstQuery) Kind() QueryKind

func (SpanFirstQuery) MarshalBSON

func (q SpanFirstQuery) MarshalBSON() ([]byte, error)

func (SpanFirstQuery) MarshalJSON

func (q SpanFirstQuery) MarshalJSON() ([]byte, error)

func (SpanFirstQuery) Name

func (n SpanFirstQuery) Name() string

func (*SpanFirstQuery) SetName

func (n *SpanFirstQuery) SetName(name string)

func (*SpanFirstQuery) SpanFirst

func (q *SpanFirstQuery) SpanFirst() (*SpanFirstQuery, error)

func (*SpanFirstQuery) UnmarshalBSON

func (q *SpanFirstQuery) UnmarshalBSON(data []byte) error

func (*SpanFirstQuery) UnmarshalJSON

func (q *SpanFirstQuery) UnmarshalJSON(data []byte) error

type SpanFirstQueryParams

type SpanFirstQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanFirstQueryParams) Clause

func (p SpanFirstQueryParams) Clause() (QueryClause, error)

func (SpanFirstQueryParams) Complete

func (SpanFirstQueryParams) Complete()

func (SpanFirstQueryParams) Kind

func (SpanFirstQueryParams) SpanFirst

func (p SpanFirstQueryParams) SpanFirst() (*SpanFirstQuery, error)

type SpanMultiQuery

type SpanMultiQuery struct {
	// contains filtered or unexported fields
}

func (*SpanMultiQuery) Clause

func (q *SpanMultiQuery) Clause() (QueryClause, error)

func (*SpanMultiQuery) Clear

func (q *SpanMultiQuery) Clear()

func (SpanMultiQuery) Complete

func (SpanMultiQuery) Complete()

func (*SpanMultiQuery) IsEmpty

func (q *SpanMultiQuery) IsEmpty() bool

func (SpanMultiQuery) Kind

func (SpanMultiQuery) Kind() QueryKind

func (SpanMultiQuery) MarshalBSON

func (q SpanMultiQuery) MarshalBSON() ([]byte, error)

func (SpanMultiQuery) MarshalJSON

func (q SpanMultiQuery) MarshalJSON() ([]byte, error)

func (SpanMultiQuery) Name

func (n SpanMultiQuery) Name() string

func (*SpanMultiQuery) SetName

func (n *SpanMultiQuery) SetName(name string)

func (*SpanMultiQuery) SpanMulti

func (q *SpanMultiQuery) SpanMulti() (*SpanMultiQuery, error)

func (*SpanMultiQuery) UnmarshalBSON

func (q *SpanMultiQuery) UnmarshalBSON(data []byte) error

func (*SpanMultiQuery) UnmarshalJSON

func (q *SpanMultiQuery) UnmarshalJSON(data []byte) error

type SpanMultiQueryParams

type SpanMultiQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanMultiQueryParams) Clause

func (p SpanMultiQueryParams) Clause() (QueryClause, error)

func (SpanMultiQueryParams) Complete

func (SpanMultiQueryParams) Complete()

func (SpanMultiQueryParams) Kind

func (SpanMultiQueryParams) SpanMulti

func (p SpanMultiQueryParams) SpanMulti() (*SpanMultiQuery, error)

type SpanNearQuery

type SpanNearQuery struct {
	// contains filtered or unexported fields
}

func (*SpanNearQuery) Clause

func (q *SpanNearQuery) Clause() (QueryClause, error)

func (*SpanNearQuery) Clear

func (q *SpanNearQuery) Clear()

func (SpanNearQuery) Complete

func (SpanNearQuery) Complete()

func (*SpanNearQuery) IsEmpty

func (q *SpanNearQuery) IsEmpty() bool

func (SpanNearQuery) Kind

func (SpanNearQuery) Kind() QueryKind

func (SpanNearQuery) MarshalBSON

func (q SpanNearQuery) MarshalBSON() ([]byte, error)

func (SpanNearQuery) MarshalJSON

func (q SpanNearQuery) MarshalJSON() ([]byte, error)

func (SpanNearQuery) Name

func (n SpanNearQuery) Name() string

func (*SpanNearQuery) SetName

func (n *SpanNearQuery) SetName(name string)

func (*SpanNearQuery) SpanNear

func (q *SpanNearQuery) SpanNear() (*SpanNearQuery, error)

func (*SpanNearQuery) UnmarshalBSON

func (q *SpanNearQuery) UnmarshalBSON(data []byte) error

func (*SpanNearQuery) UnmarshalJSON

func (q *SpanNearQuery) UnmarshalJSON(data []byte) error

type SpanNearQueryParams

type SpanNearQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanNearQueryParams) Clause

func (p SpanNearQueryParams) Clause() (QueryClause, error)

func (SpanNearQueryParams) Complete

func (SpanNearQueryParams) Complete()

func (SpanNearQueryParams) Kind

func (SpanNearQueryParams) SpanNear

func (p SpanNearQueryParams) SpanNear() (*SpanNearQuery, error)

type SpanNotQuery

type SpanNotQuery struct {
	// contains filtered or unexported fields
}

func (*SpanNotQuery) Clause

func (q *SpanNotQuery) Clause() (QueryClause, error)

func (*SpanNotQuery) Clear

func (q *SpanNotQuery) Clear()

func (SpanNotQuery) Complete

func (SpanNotQuery) Complete()

func (*SpanNotQuery) IsEmpty

func (q *SpanNotQuery) IsEmpty() bool

func (SpanNotQuery) Kind

func (SpanNotQuery) Kind() QueryKind

func (SpanNotQuery) MarshalBSON

func (q SpanNotQuery) MarshalBSON() ([]byte, error)

func (SpanNotQuery) MarshalJSON

func (q SpanNotQuery) MarshalJSON() ([]byte, error)

func (SpanNotQuery) Name

func (n SpanNotQuery) Name() string

func (*SpanNotQuery) SetName

func (n *SpanNotQuery) SetName(name string)

func (*SpanNotQuery) SpanNot

func (q *SpanNotQuery) SpanNot() (*SpanNotQuery, error)

func (*SpanNotQuery) UnmarshalBSON

func (q *SpanNotQuery) UnmarshalBSON(data []byte) error

func (*SpanNotQuery) UnmarshalJSON

func (q *SpanNotQuery) UnmarshalJSON(data []byte) error

type SpanNotQueryParams

type SpanNotQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanNotQueryParams) Clause

func (p SpanNotQueryParams) Clause() (QueryClause, error)

func (SpanNotQueryParams) Complete

func (SpanNotQueryParams) Complete()

func (SpanNotQueryParams) Kind

func (SpanNotQueryParams) SpanNot

func (p SpanNotQueryParams) SpanNot() (*SpanNotQuery, error)

type SpanOrQuery

type SpanOrQuery struct {
	// contains filtered or unexported fields
}

func (*SpanOrQuery) Clause

func (q *SpanOrQuery) Clause() (QueryClause, error)

func (*SpanOrQuery) Clear

func (q *SpanOrQuery) Clear()

func (SpanOrQuery) Complete

func (SpanOrQuery) Complete()

func (*SpanOrQuery) IsEmpty

func (q *SpanOrQuery) IsEmpty() bool

func (SpanOrQuery) Kind

func (SpanOrQuery) Kind() QueryKind

func (SpanOrQuery) MarshalBSON

func (q SpanOrQuery) MarshalBSON() ([]byte, error)

func (SpanOrQuery) MarshalJSON

func (q SpanOrQuery) MarshalJSON() ([]byte, error)

func (SpanOrQuery) Name

func (n SpanOrQuery) Name() string

func (*SpanOrQuery) SetName

func (n *SpanOrQuery) SetName(name string)

func (*SpanOrQuery) SpanOr

func (q *SpanOrQuery) SpanOr() (*SpanOrQuery, error)

func (*SpanOrQuery) UnmarshalBSON

func (q *SpanOrQuery) UnmarshalBSON(data []byte) error

func (*SpanOrQuery) UnmarshalJSON

func (q *SpanOrQuery) UnmarshalJSON(data []byte) error

type SpanOrQueryParams

type SpanOrQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanOrQueryParams) Clause

func (p SpanOrQueryParams) Clause() (QueryClause, error)

func (SpanOrQueryParams) Complete

func (SpanOrQueryParams) Complete()

func (SpanOrQueryParams) Kind

func (SpanOrQueryParams) SpanOr

func (p SpanOrQueryParams) SpanOr() (*SpanOrQuery, error)

type SpanTermQuery

type SpanTermQuery struct {
	// contains filtered or unexported fields
}

func (*SpanTermQuery) Clause

func (q *SpanTermQuery) Clause() (QueryClause, error)

func (*SpanTermQuery) Clear

func (q *SpanTermQuery) Clear()

func (SpanTermQuery) Complete

func (SpanTermQuery) Complete()

func (*SpanTermQuery) IsEmpty

func (q *SpanTermQuery) IsEmpty() bool

func (SpanTermQuery) Kind

func (SpanTermQuery) Kind() QueryKind

func (SpanTermQuery) MarshalBSON

func (q SpanTermQuery) MarshalBSON() ([]byte, error)

func (SpanTermQuery) MarshalJSON

func (q SpanTermQuery) MarshalJSON() ([]byte, error)

func (SpanTermQuery) Name

func (n SpanTermQuery) Name() string

func (*SpanTermQuery) SetName

func (n *SpanTermQuery) SetName(name string)

func (*SpanTermQuery) SpanTerm

func (q *SpanTermQuery) SpanTerm() (*SpanTermQuery, error)

func (*SpanTermQuery) UnmarshalBSON

func (q *SpanTermQuery) UnmarshalBSON(data []byte) error

func (*SpanTermQuery) UnmarshalJSON

func (q *SpanTermQuery) UnmarshalJSON(data []byte) error

type SpanTermQueryParams

type SpanTermQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanTermQueryParams) Clause

func (p SpanTermQueryParams) Clause() (QueryClause, error)

func (SpanTermQueryParams) Complete

func (SpanTermQueryParams) Complete()

func (SpanTermQueryParams) Kind

func (SpanTermQueryParams) SpanTerm

func (p SpanTermQueryParams) SpanTerm() (*SpanTermQuery, error)

type SpanWithinQuery

type SpanWithinQuery struct {
	// contains filtered or unexported fields
}

func (*SpanWithinQuery) Clause

func (q *SpanWithinQuery) Clause() (QueryClause, error)

func (*SpanWithinQuery) Clear

func (q *SpanWithinQuery) Clear()

func (SpanWithinQuery) Complete

func (SpanWithinQuery) Complete()

func (*SpanWithinQuery) IsEmpty

func (q *SpanWithinQuery) IsEmpty() bool

func (SpanWithinQuery) Kind

func (SpanWithinQuery) Kind() QueryKind

func (SpanWithinQuery) MarshalBSON

func (q SpanWithinQuery) MarshalBSON() ([]byte, error)

func (SpanWithinQuery) MarshalJSON

func (q SpanWithinQuery) MarshalJSON() ([]byte, error)

func (SpanWithinQuery) Name

func (n SpanWithinQuery) Name() string

func (*SpanWithinQuery) SetName

func (n *SpanWithinQuery) SetName(name string)

func (*SpanWithinQuery) SpanWithin

func (q *SpanWithinQuery) SpanWithin() (*SpanWithinQuery, error)

func (*SpanWithinQuery) UnmarshalBSON

func (q *SpanWithinQuery) UnmarshalBSON(data []byte) error

func (*SpanWithinQuery) UnmarshalJSON

func (q *SpanWithinQuery) UnmarshalJSON(data []byte) error

type SpanWithinQueryParams

type SpanWithinQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (SpanWithinQueryParams) Clause

func (p SpanWithinQueryParams) Clause() (QueryClause, error)

func (SpanWithinQueryParams) Complete

func (SpanWithinQueryParams) Complete()

func (SpanWithinQueryParams) Kind

func (SpanWithinQueryParams) SpanWithin

func (p SpanWithinQueryParams) SpanWithin() (*SpanWithinQuery, error)

type SpatialRelation

type SpatialRelation string
const (

	// SpatialRelationIntersects - (default) Return all documents whose
	// geo_shape or geo_point field intersects the query geometry.
	SpatialRelationIntersects SpatialRelation = "INTERSECTS"
	// SpatialRelationDisjoint - Return all documents whose geo_shape or
	// geo_point field has nothing in common with the query geometry.
	SpatialRelationDisjoint SpatialRelation = "DISJOINT"
	// SpatialRelationWithin  - Return all documents whose geo_shape or
	// geo_point field is within the query geometry. Line geometries are not
	// supported.
	SpatialRelationWithin SpatialRelation = "WITHIN"
	// SpatialRelationContains - Return all documents whose geo_shape or
	// geo_point field contains the query geometry.
	SpatialRelationContains SpatialRelation = "CONTAINS"
)

type String

type String string

func (String) Match

func (s String) Match() (MatchQuery, error)

func (String) String

func (s String) String() string

func (String) Term

func (s String) Term() (TermQuery, error)

func (String) Terms

func (s String) Terms() (TermsQuery, error)

type Strings

type Strings []string

func (Strings) Terms

func (s Strings) Terms() (TermsQuery, error)

type TermQuery

type TermQuery struct {
	// contains filtered or unexported fields
}

TermQuery returns documents that contain an exact term in a provided field.

You can use the term query to find documents based on a precise value such as a price, a product ID, or a username.

Avoid using the term query for text fields.

By default, Elasticsearch changes the values of text fields as part of analysis. This can make finding exact matches for text field values difficult.

To search text field values, use the match query instead.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html

func NewTermQuery

func NewTermQuery(params TermQueryParams) (*TermQuery, error)

NewTermQuery creates a new TermQuery

TermQuery returns documents that contain an exact term in a provided field.

You can use the term query to find documents based on a precise value such as a price, a product ID, or a username.

Avoid using the term query for text fields.

By default, Elasticsearch changes the values of text fields as part of analysis. This can make finding exact matches for text field values difficult.

To search text field values, use the match query instead.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html

func (TermQuery) Boost

func (b TermQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (TermQuery) CaseInsensitive

func (ci TermQuery) CaseInsensitive() bool

func (*TermQuery) Clause

func (t *TermQuery) Clause() (QueryClause, error)

func (*TermQuery) Clear

func (t *TermQuery) Clear()

func (TermQuery) Complete

func (TermQuery) Complete()

func (TermQuery) Field

func (t TermQuery) Field() string

func (*TermQuery) IsEmpty

func (t *TermQuery) IsEmpty() bool

func (TermQuery) Kind

func (t TermQuery) Kind() QueryKind

func (TermQuery) MarshalBSON

func (t TermQuery) MarshalBSON() ([]byte, error)

func (TermQuery) MarshalJSON

func (t TermQuery) MarshalJSON() ([]byte, error)

func (TermQuery) Name

func (n TermQuery) Name() string

func (*TermQuery) Set

func (t *TermQuery) Set(field string, clause Termer) error

func (*TermQuery) SetBoost

func (b *TermQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*TermQuery) SetCaseInsensitive

func (ci *TermQuery) SetCaseInsensitive(v bool)

func (*TermQuery) SetName

func (n *TermQuery) SetName(name string)

func (*TermQuery) SetValue

func (t *TermQuery) SetValue(v string) error

func (*TermQuery) UnmarshalBSON

func (t *TermQuery) UnmarshalBSON(data []byte) error

func (*TermQuery) UnmarshalJSON

func (t *TermQuery) UnmarshalJSON(data []byte) error

func (TermQuery) Value

func (t TermQuery) Value() string

type TermQueryParams

type TermQueryParams struct {
	// The field which is being queried against.
	//
	// This will be ignored if set through a mutator
	Field           string
	Value           string
	Boost           interface{}
	CaseInsensitive bool
	Name            string
	// contains filtered or unexported fields
}

func (TermQueryParams) Clause

func (t TermQueryParams) Clause() (QueryClause, error)

func (TermQueryParams) Complete

func (TermQueryParams) Complete()

func (TermQueryParams) Kind

func (t TermQueryParams) Kind() QueryKind

func (TermQueryParams) Term

func (t TermQueryParams) Term() (*TermQuery, error)

type TermVector

type TermVector string

TermVector indicates which Term vectors, which contain information about the terms produced by the analysis process, including:

- a list of terms.

- the position (or order) of each term.

- the start and end character offsets mapping the term to its origin in the original string.

- payloads (if they are available) — user-defined binary data associated with each term position.

- These term vectors can be stored so that they can be retrieved for a particular document.

https://www.elastic.co/guide/en/elasticsearch/reference/current/term-vector.html

const (
	// TermVectorNone - No term vectors are stored. (default)
	TermVectorNo TermVector = "no"

	// TermVectorYes - Just the terms in the field are stored.
	TermVectorYes TermVector = "yes"

	// TermVectorWithPositions  - Terms and positions are stored.
	TermVectorWithPositions TermVector = "with_positions"

	// TermVectorWithOffsets - Terms and character offsets are stored.
	TermVectorWithOffsets TermVector = "with_offsets"

	// TermVectorWithPositionsOffsets  - Terms, positions, and character offsets are stored.
	TermVectorWithPositionsOffsets TermVector = "with_positions_offsets"

	// TermVectorWithPoisitionsPayloads - Terms, positions, and payloads are stored.
	TermVectorWithPoisitionsPayloads TermVector = "with_positions_payloads"

	// TTermVectorPositionsOffsetsPayloads - Terms, positions, offsets and payloads are stored
	TermVectorPositionsOffsetsPayloads TermVector = "with_positions_offsets_payloads"
)

func (*TermVector) IsValid

func (tv *TermVector) IsValid() bool

func (TermVector) String

func (tv TermVector) String() string

func (*TermVector) Validate

func (tv *TermVector) Validate() error

type Termer

type Termer interface {
	Term() (*TermQuery, error)
}

type TermsLookup

type TermsLookup = LookupValues

type TermsQuery

type TermsQuery struct {
	// contains filtered or unexported fields
}

func (TermsQuery) Boost

func (b TermsQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (TermsQuery) CaseInsensitive

func (ci TermsQuery) CaseInsensitive() bool

func (*TermsQuery) Clause

func (t *TermsQuery) Clause() (QueryClause, error)

func (*TermsQuery) Clear

func (t *TermsQuery) Clear()

func (TermsQuery) Complete

func (TermsQuery) Complete()

func (TermsQuery) Field

func (t TermsQuery) Field() string

func (*TermsQuery) IsEmpty

func (t *TermsQuery) IsEmpty() bool

func (TermsQuery) Kind

func (t TermsQuery) Kind() QueryKind

func (TermsQuery) Lookup

func (t TermsQuery) Lookup() *TermsLookup

func (TermsQuery) MarshalBSON

func (t TermsQuery) MarshalBSON() ([]byte, error)

func (TermsQuery) MarshalJSON

func (t TermsQuery) MarshalJSON() ([]byte, error)

func (TermsQuery) Name

func (n TermsQuery) Name() string

func (*TermsQuery) Set

func (t *TermsQuery) Set(field string, clause Termser) error

func (*TermsQuery) SetBoost

func (b *TermsQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*TermsQuery) SetCaseInsensitive

func (ci *TermsQuery) SetCaseInsensitive(v bool)

func (*TermsQuery) SetField

func (t *TermsQuery) SetField(field string)

func (*TermsQuery) SetName

func (n *TermsQuery) SetName(name string)

func (*TermsQuery) SetValue

func (t *TermsQuery) SetValue(value []string) error

func (*TermsQuery) Terms

func (t *TermsQuery) Terms() (*TermsQuery, error)

func (*TermsQuery) UnmarshalBSON

func (t *TermsQuery) UnmarshalBSON(data []byte) error

func (*TermsQuery) UnmarshalJSON

func (t *TermsQuery) UnmarshalJSON(data []byte) error

func (TermsQuery) Value

func (t TermsQuery) Value() []string

type TermsQueryParams

type TermsQueryParams struct {
	Field           string
	Value           []string
	Boost           interface{}
	CaseInsensitive bool
	// contains filtered or unexported fields
}

TermsQueryParams returns documents that contain one or more exact terms in a provided field.

The terms query is the same as the term query, except you can search for multiple values.

func (TermsQueryParams) Clause

func (t TermsQueryParams) Clause() (QueryClause, error)

func (TermsQueryParams) Complete

func (TermsQueryParams) Complete()

func (TermsQueryParams) Kind

func (t TermsQueryParams) Kind() QueryKind

func (TermsQueryParams) Terms

func (t TermsQueryParams) Terms() (*TermsQuery, error)

type TermsSetQuery

type TermsSetQuery struct {
	// contains filtered or unexported fields
}

func (TermsSetQuery) Boost

func (b TermsSetQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (*TermsSetQuery) Clause

func (q *TermsSetQuery) Clause() (QueryClause, error)

func (*TermsSetQuery) Clear

func (q *TermsSetQuery) Clear()

func (TermsSetQuery) Complete

func (TermsSetQuery) Complete()

func (TermsSetQuery) Field

func (f TermsSetQuery) Field() string

func (*TermsSetQuery) IsEmpty

func (q *TermsSetQuery) IsEmpty() bool

func (TermsSetQuery) Kind

func (TermsSetQuery) Kind() QueryKind

func (TermsSetQuery) MarshalBSON

func (q TermsSetQuery) MarshalBSON() ([]byte, error)

func (TermsSetQuery) MarshalJSON

func (q TermsSetQuery) MarshalJSON() ([]byte, error)

func (TermsSetQuery) MinimumShouldMatchField

func (q TermsSetQuery) MinimumShouldMatchField() string

func (TermsSetQuery) MinimumShouldMatchScript

func (q TermsSetQuery) MinimumShouldMatchScript() *Script

func (TermsSetQuery) Name

func (n TermsSetQuery) Name() string

func (*TermsSetQuery) SetBoost

func (b *TermsSetQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*TermsSetQuery) SetField

func (f *TermsSetQuery) SetField(field string) error

func (*TermsSetQuery) SetMinimumShouldMatchField

func (q *TermsSetQuery) SetMinimumShouldMatchField(v string)

func (*TermsSetQuery) SetMinimumShouldMatchScript

func (q *TermsSetQuery) SetMinimumShouldMatchScript(script *Script)

func (*TermsSetQuery) SetName

func (n *TermsSetQuery) SetName(name string)

func (*TermsSetQuery) SetTerms

func (q *TermsSetQuery) SetTerms(terms []string) error

func (TermsSetQuery) Terms

func (q TermsSetQuery) Terms() []string

func (*TermsSetQuery) TermsSet

func (q *TermsSetQuery) TermsSet() (*TermsSetQuery, error)

func (*TermsSetQuery) UnmarshalBSON

func (q *TermsSetQuery) UnmarshalBSON(data []byte) error

func (*TermsSetQuery) UnmarshalJSON

func (q *TermsSetQuery) UnmarshalJSON(data []byte) error

type TermsSetQueryParams

type TermsSetQueryParams struct {
	Name string
	// (Required) Field you wish to search.
	Field string
	// (Required, array of strings) Array of terms you wish to find in the
	// provided <field>. To return a document, a required number of terms must
	// exactly match the field values, including whitespace and capitalization.
	//
	// The required number of matching terms is defined in the
	// minimum_should_match_field or minimum_should_match_script parameter.
	Terms []string
	// (Optional, string) Numeric field containing the number of matching terms
	// required to return a document.
	MinimumShouldMatchField string
	//  Custom script containing the number of matching terms required to return
	//  a document.
	MinimumShouldMatchScript *Script
	Boost                    interface{}
	// contains filtered or unexported fields
}

func (TermsSetQueryParams) Clause

func (p TermsSetQueryParams) Clause() (QueryClause, error)

func (TermsSetQueryParams) Complete

func (TermsSetQueryParams) Complete()

func (TermsSetQueryParams) Kind

func (TermsSetQueryParams) TermsSet

func (p TermsSetQueryParams) TermsSet() (*TermsSetQuery, error)

type TermsSetter

type TermsSetter interface {
	TermsSet() (*TermsSetQuery, error)
}

type Termser

type Termser interface {
	Terms() (*TermsQuery, error)
}

Termser can be:

*picker.Terms
*picker.Lookup
picker.String
picker.Strings

type TextField

type TextField struct {
	// contains filtered or unexported fields
}

A TextField is a field to index full-text values, such as the body of an email or the description of a product. These fields are analyzed, that is they are passed through an analyzer to convert the string into a list of individual terms before being indexed. The analysis process allows Elasticsearch to search for individual words within each full text field. Text fields are not used for sorting and seldom used for aggregations (although the significant text aggregation is a notable exception).

text fields are best suited for unstructured but human-readable content. If you need to index unstructured machine-generated content, see Mapping unstructured content.

If you need to index structured content such as email addresses, hostnames, status codes, or tags, it is likely that you should rather use a keyword field.

Use a field as both text and keyword

Sometimes it is useful to have both a full text (text) and a keyword (keyword) version of the same field: one for full text search and the other for aggregations and sorting. This can be achieved with multi-fields.

https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html

func NewTextField

func NewTextField(params TextFieldParams) (*TextField, error)

func (TextField) Analyzer

func (ap TextField) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (TextField) Boost

func (b TextField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (TextField) EagerGlobalOrdinals

func (ego TextField) EagerGlobalOrdinals() bool

To support aggregations and other operations that require looking up field values on a per-document basis, Elasticsearch uses a data structure called doc values. Term-based field types such as keyword store their doc values using an ordinal mapping for a more compact representation. This mapping works by assigning each term an incremental integer or ordinal based on its lexicographic order. The field’s doc values store only the ordinals for each document instead of the original terms, with a separate lookup structure to convert between ordinals and terms.

When used during aggregations, ordinals can greatly improve performance. As an example, the terms aggregation relies only on ordinals to collect documents into buckets at the shard-level, then converts the ordinals back to their original term values when combining results across shards.

Each index segment defines its own ordinal mapping, but aggregations collect data across an entire shard. So to be able to use ordinals for shard-level operations like aggregations, Elasticsearch creates a unified mapping called global ordinals. The global ordinal mapping is built on top of segment ordinals, and works by maintaining a map from global ordinal to the local ordinal for each segment.

Global ordinals are used if a search contains any of the following components:

- Certain bucket aggregations on keyword, ip, and flattened fields. This includes terms aggregations as mentioned above, as well as composite, diversified_sampler, and significant_terms.

- Bucket aggregations on text fields that require fielddata to be enabled.

- Operations on parent and child documents from a join field, including has_child queries and parent aggregations.

https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html

func (*TextField) Field

func (t *TextField) Field() (Field, error)

func (TextField) FieldData

func (fd TextField) FieldData() bool

FieldData determines whether the field use in-memory fielddata for sorting, aggregations, or scripting. Accepts true or false (default).

func (TextField) FieldDataFrequencyFilter

func (fd TextField) FieldDataFrequencyFilter() *FieldDataFrequencyFilter

FieldDataFrequencyFilter can be used to reduce the number of terms loaded into memory, and thus reduce memory usage when using FieldData filtering.

func (TextField) Fields

func (f TextField) Fields() Fields

Fields (Multi-fields) allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.

func (TextField) Index

func (i TextField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (TextField) IndexOptions

func (io TextField) IndexOptions() IndexOptions

IndexOptions parameter controls what information is added to the inverted index for search and highlighting purposes.

func (TextField) IndexPhrases

func (cp TextField) IndexPhrases() bool

IndexPhrases is a param that if enabled, two-term word combinations (shingles) are indexed into a separate field. This allows exact phrase queries (no slop) to run more efficiently, at the expense of a larger index.

Note that this works best when stopwords are not removed, as phrases containing stopwords will not use the subsidiary field and will fall back to a standard phrase query. Accepts true or false (default).

func (TextField) IndexPrefixes

func (ip TextField) IndexPrefixes() *IndexPrefixes

func (TextField) MarshalBSON

func (t TextField) MarshalBSON() ([]byte, error)

func (TextField) MarshalJSON

func (t TextField) MarshalJSON() ([]byte, error)

func (TextField) Meta

func (m TextField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (TextField) Norms

func (n TextField) Norms() bool

Norms determines whether field-length should be taken into account when scoring queries. Accepts true (default) or false.

func (TextField) PositionIncrementGap

func (pig TextField) PositionIncrementGap() float64

PositionIncrementGap is the number of fake term position which should be inserted between each element of an array of strings. Defaults to the position_increment_gap configured on the analyzer which defaults to 100. 100 was chosen because it prevents phrase queries with reasonably large slops (less than 100) from matching terms across field values.

func (TextField) SearchAnalyzer

func (sa TextField) SearchAnalyzer() string

SearchAnalyzer overrides Analyzer for search analysis

func (TextField) SearchQuoteAnalyzer

func (sq TextField) SearchQuoteAnalyzer() string

SearchQuoteAnalyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

func (*TextField) SetAnalyzer

func (ap *TextField) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*TextField) SetBoost

func (b *TextField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*TextField) SetEagerGlobalOrdinals

func (ego *TextField) SetEagerGlobalOrdinals(v interface{}) error

SetEagerGlobalOrdinals sets the eager_global_ordinals value to v

func (*TextField) SetFieldData

func (fd *TextField) SetFieldData(v interface{}) error

SetFieldData sets FieldData to v

func (*TextField) SetFieldDataFrequencyFilter

func (fd *TextField) SetFieldDataFrequencyFilter(v *FieldDataFrequencyFilter) error

SetFieldDataFrequencyFilter sets the FieldDataFrequencyFilter value to v

func (*TextField) SetFields

func (f *TextField) SetFields(fields Fieldset) error

SetFields sets the Fields value to v

func (*TextField) SetIndex

func (i *TextField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*TextField) SetIndexOptions

func (io *TextField) SetIndexOptions(v IndexOptions) error

SetIndexOptions sets IndexOptions value to v

func (*TextField) SetIndexPhrases

func (cp *TextField) SetIndexPhrases(v interface{}) error

SetIndexPhrases sets the IndexPhrases value to v

func (*TextField) SetIndexPrefixes

func (ip *TextField) SetIndexPrefixes(v *IndexPrefixes) error

func (*TextField) SetMeta

func (m *TextField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*TextField) SetNorms

func (n *TextField) SetNorms(v interface{}) error

SetNorms sets the Norms value to v

func (*TextField) SetPositionIncrementGap

func (pig *TextField) SetPositionIncrementGap(v interface{}) error

SetPositionIncrementGap sets the PositionIncrementGap Value to v

func (*TextField) SetSearchAnalyzer

func (sa *TextField) SetSearchAnalyzer(v string)

SetSearchAnalyzer sets search_analyzer to v

func (TextField) SetSearchQuoteAnalyzer

func (sq TextField) SetSearchQuoteAnalyzer(v string)

SetSearchQuoteAnalyzer sets search_quote_analyzer to v

func (*TextField) SetSimilarity

func (s *TextField) SetSimilarity(v Similarity) error

SetSimilarity sets the Similarity Value to v

func (*TextField) SetStore

func (sa *TextField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (*TextField) SetTermVector

func (tv *TextField) SetTermVector(v TermVector) error

SetTermVector sets the TermVector Value to v

func (TextField) Similarity

func (s TextField) Similarity() Similarity

Similarity is mostly useful for text fields, but can also apply to other field types.

func (TextField) Store

func (sa TextField) Store() bool

Store returns the StoreAttr Value or false

func (TextField) TermVector

func (tv TextField) TermVector() TermVector

TermVector determines whether term vectors should be stored for the field. Defaults to "no" / TermVectorNone.

func (TextField) Type

func (TextField) Type() FieldType

func (*TextField) UnmarshalBSON

func (t *TextField) UnmarshalBSON(data []byte) error

func (*TextField) UnmarshalJSON

func (t *TextField) UnmarshalJSON(data []byte) error

type TextFieldParams

type TextFieldParams struct {
	// The analyzer which should be used for the text field, both at index-time
	// and at search-time (unless overridden by the search_analyzer). Defaults
	// to the default index analyzer, or the standard analyzer.
	Analyzer string `json:"analyzer,omitempty"`
	// Should global ordinals be loaded eagerly on refresh? Accepts true or false
	// (default). Enabling this is a good idea on fields that are frequently used
	// for (significant) terms aggregations.
	EagerGlobalOrdinals interface{} `json:"eager_global_ordinals,omitempty"`
	// Can the field use in-memory fielddata for sorting, aggregations, or
	// scripting? Accepts true or false (default).
	FieldData interface{} `json:"fielddata,omitempty"`
	// Expert settings which allow to decide which values to load in memory when
	// fielddata is enabled. By default all values are loaded.
	FieldDataFrequencyFilter *FieldDataFrequencyFilter `json:"fielddata_frequency_filter,omitempty"`
	// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers.
	Fields FieldMap `json:"fields,omitempty"`
	// Should the field be searchable? Accepts true (default) or false.
	Index interface{} `json:"index,omitempty"`
	// What information should be stored in the index, for search and
	// highlighting purposes. Defaults to positions
	IndexOptions IndexOptions `json:"index_options,omitempty"`
	// If enabled, term prefixes of between 2 and 5 characters are indexed into
	// a separate field. This allows prefix searches to run more efficiently, at
	// the expense of a larger index.
	IndexPrefixes *IndexPrefixes `json:"index_prefixes,omitempty"`

	// If enabled, two-term word combinations (shingles) are indexed into a separate field. This allows exact phrase queries (no slop) to run more efficiently, at the expense of a larger index. Note that this works best when stopwords are not removed, as phrases containing stopwords will not use the subsidiary field and will fall back to a standard phrase query. Accepts true or false (default).
	IndexPhrases interface{} `json:"index_phrases,omitempty"`

	// Whether field-length should be taken into account when scoring queries.
	// Accepts true (default) or false.
	Norms interface{} `json:"norms,omitempty"`

	// The number of fake term position which should be inserted between each element of an array of strings. Defaults to the position_increment_gap configured on the analyzer which defaults to 100. 100 was chosen because it prevents phrase queries with reasonably large slops (less than 100) from matching terms across field values.
	PositionIncrementGap interface{} `json:"position_increment_gap,omitempty"`

	// Whether the field value should be stored and retrievable separately from
	// the _source field. Accepts true or false (default).
	Store interface{} `json:"store,omitempty"`
	// The analyzer that should be used at search time on the text field. Defaults to the analyzer setting.
	SearchAnalyzer string `json:"search_analyzer,omitempty"`
	// The analyzer that should be used at search time when a phrase is
	// encountered. Defaults to the search_analyzer setting.
	SearchQuoteAnalyzer string `json:"search_quote_analyzer,omitempty"`

	// Which scoring algorithm or similarity should be used. Defaults to BM25.
	Similarity Similarity `json:"similarity,omitempty"`
	// Whether term vectors should be stored for the field. Defaults to no.
	TermVector TermVector `json:"term_vector,omitempty"`
	// Metadata about the field.
	Meta Meta `json:"meta,omitempty"`
	// Deprecated
	//
	// Mapping field-level query time boosting. Accepts a floating point number, defaults to 1.0.
	Boost interface{} `json:"boost,omitempty"`
}

func (TextFieldParams) Field

func (p TextFieldParams) Field() (Field, error)

func (TextFieldParams) Text

func (p TextFieldParams) Text() (*TextField, error)

func (TextFieldParams) Type

func (TextFieldParams) Type() FieldType

type TokenCountField

type TokenCountField struct {
	// contains filtered or unexported fields
}

A TokenCountField is really an integer field which accepts string values, analyzes them, then indexes the number of tokens in the string.

https://www.elastic.co/guide/en/elasticsearch/reference/current/token-count.html

func NewTokenCountField

func NewTokenCountField(params TokenCountFieldParams) (*TokenCountField, error)

func (TokenCountField) Analyzer

func (ap TokenCountField) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (TokenCountField) Boost

func (b TokenCountField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (TokenCountField) DocValues

func (dv TokenCountField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (TokenCountField) EnablePositionIncrements

func (epi TokenCountField) EnablePositionIncrements() bool

EnablePositionIncrements deteremines if all fields in the nested object are also added to the root document as standard (flat) fields. Defaults to false

func (*TokenCountField) Field

func (t *TokenCountField) Field() (Field, error)

func (TokenCountField) Index

func (i TokenCountField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (TokenCountField) MarshalBSON

func (t TokenCountField) MarshalBSON() ([]byte, error)

func (TokenCountField) MarshalJSON

func (t TokenCountField) MarshalJSON() ([]byte, error)

func (TokenCountField) NullValue

func (nv TokenCountField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*TokenCountField) SetAnalyzer

func (ap *TokenCountField) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*TokenCountField) SetBoost

func (b *TokenCountField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*TokenCountField) SetDocValues

func (dv *TokenCountField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*TokenCountField) SetEnablePositionIncrements

func (epi *TokenCountField) SetEnablePositionIncrements(v interface{}) error

SetEnablePositionIncrements sets the EnablePositionIncrements Value to v

func (*TokenCountField) SetIndex

func (i *TokenCountField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*TokenCountField) SetNullValue

func (nv *TokenCountField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*TokenCountField) SetStore

func (sa *TokenCountField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (TokenCountField) Store

func (sa TokenCountField) Store() bool

Store returns the StoreAttr Value or false

func (TokenCountField) Type

func (TokenCountField) Type() FieldType

func (*TokenCountField) UnmarshalBSON

func (t *TokenCountField) UnmarshalBSON(data []byte) error

func (*TokenCountField) UnmarshalJSON

func (t *TokenCountField) UnmarshalJSON(data []byte) error

type TokenCountFieldParams

type TokenCountFieldParams struct {
	// The analyzer which should be used to analyze the string value. Required.
	// For best performance, use an analyzer without token filters.
	Analyzer string `json:"analyzer,omitempty"`
	// Indicates if position increments should be counted. Set to false if you
	// don’t want to count tokens removed by analyzer filters (like stop).
	// Defaults to true.
	EnablePositionIncrements interface{} `json:"enable_position_increments,omitempty"`
	// 	Should the field be stored on disk in a column-stride fashion, so that
	// 	it can later be used for sorting, aggregations, or scripting? Accepts
	// 	true (default) or false.
	DocValues interface{} `json:"doc_values,omitempty"`
	// Should the field be searchable? Accepts true (default) and false.
	Index interface{} `json:"index,omitempty"`
	// Accepts a numeric value of the same type as the field which is
	// substituted for any explicit null values. Defaults to null, which means
	// the field is treated as missing.
	NullValue interface{} `json:"null_value,omitempty"`
	// Deprecated
	Boost interface{} `json:"boost,omitempty"`
	// Whether the field value should be stored and retrievable separately from
	// the _source field. Accepts true or false (default).
	Store interface{} `json:"store,omitempty"`
}

func (TokenCountFieldParams) Field

func (p TokenCountFieldParams) Field() (Field, error)

func (TokenCountFieldParams) TokenCount

func (p TokenCountFieldParams) TokenCount() (*TokenCountField, error)

func (TokenCountFieldParams) Type

type TypeQuery

type TypeQuery struct {
	// contains filtered or unexported fields
}

func (*TypeQuery) Clause

func (q *TypeQuery) Clause() (QueryClause, error)

func (*TypeQuery) Clear

func (q *TypeQuery) Clear()

func (TypeQuery) Complete

func (TypeQuery) Complete()

func (*TypeQuery) IsEmpty

func (q *TypeQuery) IsEmpty() bool

func (TypeQuery) Kind

func (TypeQuery) Kind() QueryKind

func (TypeQuery) MarshalBSON

func (q TypeQuery) MarshalBSON() ([]byte, error)

func (TypeQuery) MarshalJSON

func (q TypeQuery) MarshalJSON() ([]byte, error)

func (TypeQuery) Name

func (n TypeQuery) Name() string

func (*TypeQuery) SetName

func (n *TypeQuery) SetName(name string)

func (*TypeQuery) Type

func (q *TypeQuery) Type() (*TypeQuery, error)

func (*TypeQuery) UnmarshalBSON

func (q *TypeQuery) UnmarshalBSON(data []byte) error

func (*TypeQuery) UnmarshalJSON

func (q *TypeQuery) UnmarshalJSON(data []byte) error

type TypeQueryParams

type TypeQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (TypeQueryParams) Clause

func (p TypeQueryParams) Clause() (QueryClause, error)

func (TypeQueryParams) Complete

func (TypeQueryParams) Complete()

func (TypeQueryParams) Kind

func (TypeQueryParams) Kind() QueryKind

func (TypeQueryParams) Type

func (p TypeQueryParams) Type() (*TypeQuery, error)

type Typer

type Typer interface {
	Type() (*TypeQuery, error)
}

type UnsignedLongField

type UnsignedLongField struct {
	// contains filtered or unexported fields
}

An UnsignedLongField is an unsigned 64-bit integer with a minimum value of 0 and a maximum value of 264-1.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func NewUnsignedLongField

func NewUnsignedLongField(params UnsignedLongFieldParams) (*UnsignedLongField, error)

func (UnsignedLongField) Boost

func (b UnsignedLongField) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (UnsignedLongField) Coerce

func (cp UnsignedLongField) Coerce() bool

Coerce attempts to clean up dirty values to fit the data type of a field.

func (UnsignedLongField) DocValues

func (dv UnsignedLongField) DocValues() bool

DocValues returns DocValues, defaulted to true

func (*UnsignedLongField) Field

func (ul *UnsignedLongField) Field() (Field, error)

func (UnsignedLongField) IgnoreMalformed

func (im UnsignedLongField) IgnoreMalformed() bool

IgnoreMalformed determines if malformed numbers are ignored. If true, malformed numbers are ignored. If false (default), malformed numbers throw an exception and reject the whole document.

func (UnsignedLongField) Index

func (i UnsignedLongField) Index() bool

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (UnsignedLongField) MarshalJSON

func (ul UnsignedLongField) MarshalJSON() ([]byte, error)

func (UnsignedLongField) Meta

func (m UnsignedLongField) Meta() Meta

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (UnsignedLongField) NullValue

func (nv UnsignedLongField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (*UnsignedLongField) SetBoost

func (b *UnsignedLongField) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*UnsignedLongField) SetCoerce

func (cp *UnsignedLongField) SetCoerce(v interface{}) error

SetCoerce sets CoerceParam to v

func (*UnsignedLongField) SetDocValues

func (dv *UnsignedLongField) SetDocValues(v interface{}) error

SetDocValues sets Value to v (bool)

func (*UnsignedLongField) SetIgnoreMalformed

func (im *UnsignedLongField) SetIgnoreMalformed(v interface{}) error

SetIgnoreMalformed sets ignore_malformed to v

func (*UnsignedLongField) SetIndex

func (i *UnsignedLongField) SetIndex(v interface{}) error

SetIndex sets the Index value to v

Index controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

func (*UnsignedLongField) SetMeta

func (m *UnsignedLongField) SetMeta(v Meta) error

SetMeta sets the metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

func (*UnsignedLongField) SetNullValue

func (nv *UnsignedLongField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (*UnsignedLongField) SetStore

func (sa *UnsignedLongField) SetStore(v interface{}) error

SetStore sets StoreAttr Value to v

func (UnsignedLongField) Store

func (sa UnsignedLongField) Store() bool

Store returns the StoreAttr Value or false

func (UnsignedLongField) Type

func (*UnsignedLongField) UnmarshalJSON

func (ul *UnsignedLongField) UnmarshalJSON(data []byte) error

type UnsignedLongFieldParams

type UnsignedLongFieldParams numberFieldParams

UnsignedLongFieldParams are params for an UnsignedLongField which is an unsigned 64-bit integer with a minimum value of 0 and a maximum value of 264-1.

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html

func (UnsignedLongFieldParams) Field

func (l UnsignedLongFieldParams) Field() (Field, error)

func (UnsignedLongFieldParams) Type

func (UnsignedLongFieldParams) UnsignedLong

func (l UnsignedLongFieldParams) UnsignedLong() (*UnsignedLongField, error)

type UpdateByQuerier

type UpdateByQuerier interface {
	UpdateByQuery() (*UpdateByQuery, error)
}

type UpdateByQuery

type UpdateByQuery struct {
	// contains filtered or unexported fields
}

func NewUpdateByQuery

func NewUpdateByQuery(params UpdateByQueryParams) (*UpdateByQuery, error)

func (*UpdateByQuery) Conflicts

func (u *UpdateByQuery) Conflicts() Conflicts

func (UpdateByQuery) Encode

func (u UpdateByQuery) Encode() (*bytes.Buffer, error)

func (UpdateByQuery) MarshalBSON

func (u UpdateByQuery) MarshalBSON() ([]byte, error)

func (UpdateByQuery) MarshalJSON

func (u UpdateByQuery) MarshalJSON() ([]byte, error)

func (*UpdateByQuery) Query

func (u *UpdateByQuery) Query() *Query

func (*UpdateByQuery) Script

func (u *UpdateByQuery) Script() *Script

func (*UpdateByQuery) SetConflicts

func (u *UpdateByQuery) SetConflicts(c Conflicts)

func (*UpdateByQuery) SetQuery

func (u *UpdateByQuery) SetQuery(query Querier) error

func (*UpdateByQuery) SetScript

func (u *UpdateByQuery) SetScript(script *Script)

func (*UpdateByQuery) UnmarshalBSON

func (u *UpdateByQuery) UnmarshalBSON(data []byte) error

func (*UpdateByQuery) UnmarshalJSON

func (u *UpdateByQuery) UnmarshalJSON(data []byte) error

type UpdateByQueryParams

type UpdateByQueryParams struct {
	Query     Querier
	Script    *Script
	Conflicts Conflicts
}

func (UpdateByQueryParams) UpdateByQuery

func (p UpdateByQueryParams) UpdateByQuery() (*UpdateByQuery, error)

type UpdateByQueryResponse

type UpdateByQueryResponse struct {
	Took                 int64         `json:"took"`
	TimedOut             bool          `json:"timed_out"`
	Total                int64         `json:"total"`
	Updated              int64         `json:"updated"`
	Deleted              int64         `json:"deleted"`
	Batches              int64         `json:"batches"`
	VersionConflicts     int64         `json:"version_conflicts"`
	Noops                int64         `json:"noops"`
	Retries              Retries       `json:"retries"`
	ThrottledMillis      int64         `json:"throttled_millis"`
	RequestsPerSecond    float64       `json:"requests_per_second"`
	Failures             []interface{} `json:"failures"`
	ThrottledUntilMillis int64         `json:"throttled_until_millis"`
}

func DecodeUpdateByQueryResponse

func DecodeUpdateByQueryResponse(body io.Reader) (*UpdateByQueryResponse, error)

type ValidationMethod

type ValidationMethod string
const (
	ValidationMethodStrict          ValidationMethod = "STRICT"
	ValidationMethodIgnoreMalformed ValidationMethod = "IGNORE_MALFORMED"
	ValidationMethodCoerce          ValidationMethod = "COERCE"
)

type Vertices

type Vertices struct {
	Top    interface{} `json:"top"`
	Bottom interface{} `json:"bottom"`
	Left   interface{} `json:"left"`
	Right  interface{} `json:"right"`
}

Vertices for GeoBoundingBoxQuery

func (Vertices) BoundingBox

func (v Vertices) BoundingBox() interface{}

func (Vertices) MarshalEasyJSON

func (v Vertices) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Vertices) MarshalJSON

func (v Vertices) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Vertices) UnmarshalEasyJSON

func (v *Vertices) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Vertices) UnmarshalJSON

func (v *Vertices) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type WKT

type WKT string

func (WKT) BoundingBox

func (wkt WKT) BoundingBox() interface{}

func (WKT) MarshalEasyJSON

func (wkt WKT) MarshalEasyJSON(w *jwriter.Writer)

func (WKT) MarshalJSON

func (wkt WKT) MarshalJSON() ([]byte, error)

func (WKT) String

func (wkt WKT) String() string

type WeightFunction

type WeightFunction struct {
	// contains filtered or unexported fields
}

func (WeightFunction) Filter

func (w WeightFunction) Filter() QueryClause

func (WeightFunction) FuncKind

func (WeightFunction) FuncKind() FuncKind

func (WeightFunction) MarshalBSON

func (w WeightFunction) MarshalBSON() ([]byte, error)

func (WeightFunction) MarshalJSON

func (w WeightFunction) MarshalJSON() ([]byte, error)

func (*WeightFunction) SetFilter

func (w *WeightFunction) SetFilter(c CompleteClauser) error

func (*WeightFunction) SetWeight

func (b *WeightFunction) SetWeight(v interface{}) error

SetWeight sets Weight to v

func (*WeightFunction) UnmarshalBSON

func (w *WeightFunction) UnmarshalBSON(data []byte) error

func (*WeightFunction) UnmarshalJSON

func (w *WeightFunction) UnmarshalJSON(data []byte) error

func (*WeightFunction) Weight

func (b *WeightFunction) Weight() float64

type WeightFunctionParams

type WeightFunctionParams struct {
	// Weight
	Weight float64
	Filter CompleteClauser
}

func (WeightFunctionParams) FuncKind

func (WeightFunctionParams) FuncKind() FuncKind

func (WeightFunctionParams) Function

func (w WeightFunctionParams) Function() (Function, error)

type WildcardField

type WildcardField struct {
	// contains filtered or unexported fields
}

A WildcardField stores values optimised for wildcard grep-like queries. Wildcard queries are possible on other field types but suffer from constraints:

- text fields limit matching of any wildcard expressions to individual tokens rather than the original whole value held in a field

- keyword fields are untokenized but slow at performing wildcard queries (especially patterns with leading wildcards).

Internally the wildcard field indexes the whole field value using ngrams and stores the full string. The index is used as a rough filter to cut down the number of values that are then checked by retrieving and checking the full values. This field is especially well suited to run grep-like queries on log lines. Storage costs are typically lower than those of keyword fields but search speeds for exact matches on full terms are slower.

Limitations

wildcard fields are untokenized like keyword fields, so do not support queries that rely on word positions such as phrase queries.

https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#wildcard-field-type

func NewWildcardField

func NewWildcardField(params WildcardFieldParams) (*WildcardField, error)

func (*WildcardField) Field

func (w *WildcardField) Field() (Field, error)

func (WildcardField) IgnoreAbove

func (ia WildcardField) IgnoreAbove() float64

IgnoreAbove signals to not index any string longer than this value. Defaults to 2147483647 so that all values would be accepted. Please however note that default dynamic mapping rules create a sub keyword field that overrides this default by setting ignore_above: 256.

func (WildcardField) MarshalBSON

func (w WildcardField) MarshalBSON() ([]byte, error)

func (WildcardField) MarshalJSON

func (w WildcardField) MarshalJSON() ([]byte, error)

func (WildcardField) NullValue

func (nv WildcardField) NullValue() interface{}

NullValue parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

func (WildcardField) SetIgnoreAbove

func (ia WildcardField) SetIgnoreAbove(v interface{}) error

SetIgnoreAbove sets the IgnoreAbove value to v

func (*WildcardField) SetNullValue

func (nv *WildcardField) SetNullValue(v interface{})

SetNullValue sets the NullValue value to v

func (WildcardField) Type

func (WildcardField) Type() FieldType

func (*WildcardField) UnmarshalBSON

func (w *WildcardField) UnmarshalBSON(data []byte) error

func (*WildcardField) UnmarshalJSON

func (w *WildcardField) UnmarshalJSON(data []byte) error

type WildcardFieldParams

type WildcardFieldParams struct {
	// NullValue parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	NullValue interface{} `json:"null_value,omitempty"`
	// IgnoreAbove signiall to not index any string longer than this value.
	// Defaults to 2147483647 so that all values would be accepted. Please
	// however note that default dynamic mapping rules create a sub keyword
	// field that overrides this default by setting ignore_above: 256.
	IgnoreAbove interface{} `json:"ignore_above,omitempty"`
}

func (WildcardFieldParams) Field

func (p WildcardFieldParams) Field() (Field, error)

func (WildcardFieldParams) Type

func (WildcardFieldParams) Wildcard

func (p WildcardFieldParams) Wildcard() (*WildcardField, error)

type WildcardQuery

type WildcardQuery struct {
	// contains filtered or unexported fields
}

func (WildcardQuery) Boost

func (b WildcardQuery) Boost() float64

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

func (WildcardQuery) CaseInsensitive

func (ci WildcardQuery) CaseInsensitive() bool

func (*WildcardQuery) Clause

func (q *WildcardQuery) Clause() (QueryClause, error)

func (*WildcardQuery) Clear

func (q *WildcardQuery) Clear()

func (WildcardQuery) Complete

func (WildcardQuery) Complete()

func (WildcardQuery) Field

func (f WildcardQuery) Field() string

func (*WildcardQuery) IsEmpty

func (q *WildcardQuery) IsEmpty() bool

func (WildcardQuery) Kind

func (WildcardQuery) Kind() QueryKind

func (WildcardQuery) MarshalBSON

func (q WildcardQuery) MarshalBSON() ([]byte, error)

func (WildcardQuery) MarshalJSON

func (q WildcardQuery) MarshalJSON() ([]byte, error)

func (WildcardQuery) Name

func (n WildcardQuery) Name() string

func (WildcardQuery) Rewrite

func (r WildcardQuery) Rewrite() Rewrite

func (*WildcardQuery) SetBoost

func (b *WildcardQuery) SetBoost(v interface{}) error

SetBoost sets Boost to v

func (*WildcardQuery) SetCaseInsensitive

func (ci *WildcardQuery) SetCaseInsensitive(v bool)

func (*WildcardQuery) SetField

func (f *WildcardQuery) SetField(field string) error

func (*WildcardQuery) SetName

func (n *WildcardQuery) SetName(name string)

func (*WildcardQuery) SetRewrite

func (r *WildcardQuery) SetRewrite(v Rewrite) error

func (*WildcardQuery) SetValue

func (q *WildcardQuery) SetValue(value string) error

func (*WildcardQuery) UnmarshalBSON

func (q *WildcardQuery) UnmarshalBSON(data []byte) error

func (*WildcardQuery) UnmarshalJSON

func (q *WildcardQuery) UnmarshalJSON(data []byte) error

func (WildcardQuery) Value

func (q WildcardQuery) Value() string

func (*WildcardQuery) Wildcard

func (q *WildcardQuery) Wildcard() (*WildcardQuery, error)

type WildcardQueryParams

type WildcardQueryParams struct {
	Name            string
	Boost           interface{}
	Value           string
	CaseInsensitive bool
	Field           string
	Rewrite         Rewrite
	// contains filtered or unexported fields
}

func (WildcardQueryParams) Clause

func (p WildcardQueryParams) Clause() (QueryClause, error)

func (WildcardQueryParams) Complete

func (WildcardQueryParams) Complete()

func (WildcardQueryParams) Kind

func (WildcardQueryParams) Wildcard

func (p WildcardQueryParams) Wildcard() (*WildcardQuery, error)

type WildcardRule

type WildcardRule struct {
	// contains filtered or unexported fields
}

func (WildcardRule) Analyzer

func (ap WildcardRule) Analyzer() string

Analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Unless overridden with the search_analyzer mapping parameter, this analyzer is used for both index and search analysis.

func (WildcardRule) Filter

func (r WildcardRule) Filter() *RuleFilter

func (WildcardRule) MarshalBSON

func (p WildcardRule) MarshalBSON() ([]byte, error)

func (WildcardRule) MarshalJSON

func (p WildcardRule) MarshalJSON() ([]byte, error)

func (*WildcardRule) Rule

func (w *WildcardRule) Rule() (QueryRule, error)

func (*WildcardRule) SetAnalyzer

func (ap *WildcardRule) SetAnalyzer(v string)

SetAnalyzer sets Analyzer to v

func (*WildcardRule) SetFilter

func (r *WildcardRule) SetFilter(filter RuleFilterer) error

func (*WildcardRule) SetUseField

func (uf *WildcardRule) SetUseField(field string)

func (*WildcardRule) SetWildcard

func (w *WildcardRule) SetWildcard(wildcard string) error

func (WildcardRule) Type

func (WildcardRule) Type() RuleType

func (*WildcardRule) UnmarshalBSON

func (p *WildcardRule) UnmarshalBSON(data []byte) error

func (*WildcardRule) UnmarshalJSON

func (p *WildcardRule) UnmarshalJSON(data []byte) error

func (WildcardRule) UseField

func (uf WildcardRule) UseField() string

func (WildcardRule) Wildcard

func (w WildcardRule) Wildcard() string

type WildcardRuleParams

type WildcardRuleParams struct {
	// (Required) Wildcard pattern used to find matching terms.
	Wildcard string `json:"wildcard"`
	// (Optional, string) analyzer used to analyze terms in the query. Defaults
	// to the top-level <field>'s analyzer.
	Analyzer string `json:"analyzer,omitempty"`
	// (Optional) An optional interval filter.
	Filter RuleFilterer `json:"filter,omitempty"`
	// (Optional) If specified, then match intervals from this field
	// rather than the top-level <field>.
	//
	// The wildcard is normalized using the search analyzer from this field,
	// unless a separate analyzer is specified.
	UseField string `json:"use_field,omitempty"`
}

func (WildcardRuleParams) Rule

func (p WildcardRuleParams) Rule() (Rule, error)

func (WildcardRuleParams) Type

func (WildcardRuleParams) WildcardRule

func (p WildcardRuleParams) WildcardRule() (*WildcardRule, error)

type Wildcarder

type Wildcarder interface {
	Wildcard() (*WildcardQuery, error)
}

type WithAllowLeadingWildcard

type WithAllowLeadingWildcard interface {
	AllowLeadingWildcard() bool
	SetAllowLeadingWildcard(v interface{}) error
}

type WithAnalyzeWildcard

type WithAnalyzeWildcard interface {
	// Default: false
	AnalyzeWildcard() bool
	// SetAnalyzeWildcard sets analyze_wildcard to v
	SetAnalyzeWildcard(v interface{}) error
}

type WithAnalyzer

type WithAnalyzer interface {
	// Analyzer parameter specifies the analyzer used for text analysis when
	// indexing or searching a text field.
	Analyzer() string
	// SetAnalyzer sets Analyzer to v
	SetAnalyzer(v string)
}

WithAnalyzer is a Field mapping with an analyzer

Analyzer

The analyzer parameter specifies the analyzer used for text analysis when indexing or searching a text field.

Only text fields support the analyzer mapping parameter.

Search Quote Analyzer

The search_quote_analyzer setting allows you to specify an analyzer for phrases, this is particularly useful when dealing with disabling stop words for phrase queries.

To disable stop words for phrases a field utilising three analyzer settings will be required:

1. An analyzer setting for indexing all terms including stop words

2. A search_analyzer setting for non-phrase queries that will remove stop words

3. A search_quote_analyzer setting for phrase queries that will not remove stop words

https://www.elastic.co/guide/en/elasticsearch/reference/current/analyzer.html

type WithAutoGenerateSynonymsPhraseQuery

type WithAutoGenerateSynonymsPhraseQuery interface {
	// AutoGenerateSynonymsPhraseQuery determines if match phrase queries are
	// automatically created for multi-term synonyms. Defaults to true.
	AutoGenerateSynonymsPhraseQuery() bool
	// SetAutoGenerateSynonymsPhraseQuery sets AutoGenerateSynonymsPhraseQueryValue to v
	SetAutoGenerateSynonymsPhraseQuery(v interface{}) error
}

WithAutoGenerateSynonymsPhraseQuery is an interface for the query mixin that adds auto_generate_synonyms_phrase_query param

type WithBoost

type WithBoost interface {
	// Boost is a floating point number used to decrease or increase the relevance
	// scores of a query. Defaults to 1.0.
	//
	// You can use the boost parameter to adjust relevance scores for searches
	// containing two or more queries.
	//
	// Boost values are relative to the default value of 1.0. A boost value between
	// 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases
	// the relevance score.
	Boost() float64
	SetBoost(v interface{}) error
}

WithBoost is an interface for queries with the boost parameter

Boost is a floating point number used to decrease or increase the relevance scores of a query. Defaults to 1.0.

You can use the boost parameter to adjust relevance scores for searches containing two or more queries.

Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

type WithBoostMode

type WithBoostMode interface {
	SetBoostMode(bm BoostMode) error
	BoostMode() BoostMode
}

type WithCaseInsensitive

type WithCaseInsensitive interface {
	CaseInsensitive() bool
	SetCaseInsensitive(v bool)
}

WithCaseInsensitive is a query mixin that adds the case_insensitive param

(Optional, Boolean) Allows ASCII case insensitive matching of the value with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html

type WithCoerce

type WithCoerce interface {
	// Coerce attempts to clean up dirty values to fit the data type of a field.
	// For instance:
	//
	// Default: false
	Coerce() bool
	// SetCoerce sets CoerceParam to v
	SetCoerce(v interface{}) error
}

WithCoerce has a Coerce param

type WithCopyTo

type WithCopyTo interface {
	CopyTo() string
	SetCopyTo(v string)
}

WithCopyTo is a Field mapping with a CopyTo param

The copy_to parameter allows you to copy the values of multiple fields into a group field, which can then be queried as a single field.

https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html

type WithCutoffFrequency

type WithCutoffFrequency interface {
	CutoffFrequency() dynamic.Number
	SetCutoffFreuency(dynamic.Number)
}

type WithDefaultOperator

type WithDefaultOperator interface {
	DefaultOperator() Operator
	SetDefaultOperator(v Operator) error
}

type WithDepthLimit

type WithDepthLimit interface {
	DepthLimit() float64
	SetDepthLimit(v interface{}) error
}

type WithDimensions

type WithDimensions interface {
	// Dimensions is the number of dimensions in the vector, required parameter.
	Dimensions() int
	// SetDimensions sets the dimensions to v
	SetDimensions(v interface{}) error
}

WithDimensions is a mapping with the dims parameter

dims is the number of dimensions in the vector, required parameter for fields that have it.

https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html

type WithDocValues

type WithDocValues interface {
	// SetDocValues sets Value to v
	SetDocValues(v interface{}) error
	// DocValues returns DocValues, defaulted to true
	DocValues() bool
}

WithDocValues is a mapping with a DocValues parameter

Most fields are indexed by default, which makes them searchable. The inverted index allows queries to look up the search term in unique sorted list of terms, and from that immediately have access to the list of documents that contain the term.

Sorting, aggregations, and access to field values in scripts requires a different data access pattern. Instead of looking up the term and finding documents, we need to be able to look up the document and find the terms that it has in a field.

Doc values are the on-disk data structure, built at document index time, which makes this data access pattern possible. They store the same values as the _source but in a column-oriented fashion that is way more efficient for sorting and aggregations. Doc values are supported on almost all field types, with the notable exception of text and annotated_text fields.

All fields which support doc values have them enabled by default. If you are sure that you don’t need to sort or aggregate on a field, or access the field value from a script, you can disable doc values in order to save disk space

https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html

type WithEagerGlobalOrdinals

type WithEagerGlobalOrdinals interface {
	// To support aggregations and other operations that require looking up field
	// values on a per-document basis, Elasticsearch uses a data structure called
	// doc values. Term-based field types such as keyword store their doc values
	// using an ordinal mapping for a more compact representation. This mapping
	// works by assigning each term an incremental integer or ordinal based on its
	// lexicographic order. The field’s doc values store only the ordinals for each
	// document instead of the original terms, with a separate lookup structure to
	// convert between ordinals and terms.
	//
	// When used during aggregations, ordinals can greatly improve performance. As
	// an example, the terms aggregation relies only on ordinals to collect
	// documents into buckets at the shard-level, then converts the ordinals back to
	// their original term values when combining results across shards.
	//
	// Each index segment defines its own ordinal mapping, but aggregations collect
	// data across an entire shard. So to be able to use ordinals for shard-level
	// operations like aggregations, Elasticsearch creates a unified mapping called
	// global ordinals. The global ordinal mapping is built on top of segment
	// ordinals, and works by maintaining a map from global ordinal to the local
	// ordinal for each segment.
	//
	// Global ordinals are used if a search contains any of the following
	// components:
	//
	// - Certain bucket aggregations on keyword, ip, and flattened fields. This
	// includes terms aggregations as mentioned above, as well as composite,
	// diversified_sampler, and significant_terms.
	//
	// - Bucket aggregations on text fields that require fielddata to be enabled.
	//
	// - Operations on parent and child documents from a join field, including
	// has_child queries and parent aggregations.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/eager-global-ordinals.html
	EagerGlobalOrdinals() bool
	// SetEagerGlobalOrdinals sets the EagerGlobalOrdinals value to v
	SetEagerGlobalOrdinals(v interface{}) error
}

type WithEnablePositionIncrements

type WithEnablePositionIncrements interface {
	//Indicates if position increments should be counted. Set to false if you
	//don’t want to count tokens removed by analyzer filters (like stop).
	//Defaults to true.
	EnablePositionIncrements() bool
	// SetEnablePositionIncrements sets the EnablePositionIncrements Value to v
	SetEnablePositionIncrements(v interface{}) error
}

WithEnablePositionIncrements is a mapping with the enable_position_increments parameter

EnablePositionIncrements Indicates if position increments should be counted. Set to false if you don’t want to count tokens removed by analyzer filters (like stop). Defaults to true.

https://www.elastic.co/guide/en/elasticsearch/reference/current/token-count.html#token-count-params

type WithEnabled

type WithEnabled interface {
	// Enabled determines whether the JSON value given for the object field should be
	// parsed and indexed (true, default) or completely ignored (false).
	Enabled() bool
	// SetEnabled sets Enabled to v
	SetEnabled(v interface{}) error
}

WithEnabled is a mapping with an enabled parameter

Enabled determines whether the JSON value given for the object field should be parsed and indexed (true, default) or completely ignored (false).

Elasticsearch tries to index all of the fields you give it, but sometimes you want to just store the field without indexing it. For instance, imagine that you are using Elasticsearch as a web session store. You may want to index the session ID and last update time, but you don’t need to query or run aggregations on the session data itself.

The enabled setting, which can be applied only to the top-level mapping definition and to object fields, causes Elasticsearch to skip parsing of the contents of the field entirely. The JSON can still be retrieved from the _source field, but it is not searchable or stored in any other way

https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html

type WithField

type WithField interface {
	Field() string
}

type WithFieldData

type WithFieldData interface {
	// FieldData determines whether the field use in-memory fielddata for
	// sorting, aggregations, or scripting. Accepts true or false (default).
	FieldData() bool
	// SetFieldData sets FieldData to v
	SetFieldData(v bool) error
}

WithFieldData is a mapping with the FieldData param

FieldData determines whether the field can use in-memory fielddata for sorting, aggregations, or scripting? Accepts true or false (default).

Text fields are searchable by default, but by default are not available for aggregations, sorting, or scripting. If you try to sort, aggregate, or access values from a script on a text field, you will see this exception:

Fielddata is disabled on text fields by default. Set fielddata=true on your_field_name in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.

Field data is the only way to access the analyzed tokens from a full text field in aggregations, sorting, or scripting. For example, a full text field like New York would get analyzed as new and york. To aggregate on these tokens requires field data.

IMPORTANT

It usually doesn’t make sense to enable fielddata on text fields. Field data is stored in the heap with the field data cache because it is expensive to calculate. Calculating the field data can cause latency spikes, and increasing heap usage is a cause of cluster performance issues.

https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#fielddata-mapping-param

type WithFieldDataFrequencyFilter

type WithFieldDataFrequencyFilter interface {
	// FieldDataFrequencyFilter can be used to reduce the number of terms loaded
	// into memory, and thus reduce memory usage when using FieldData filtering.
	FieldDataFrequencyFilter() *FieldDataFrequencyFilter
	// SetFieldDataFrequencyFilter sets the FieldDataFrequencyFilter value to v
	SetFieldDataFrequencyFilter(v *FieldDataFrequencyFilter) error
}

WithFieldDataFrequencyFilter is a mapping with the field_data_frequency_filter

FieldDataFrequencyFilter is an expert settings which allow to decide which values to load in memory when fielddata is enabled. By default all values are loaded.

FieldData filtering can be used to reduce the number of terms loaded into memory, and thus reduce memory usage. Terms can be filtered by frequency:

The frequency filter allows you to only load terms whose document frequency falls between a min and max value, which can be expressed an absolute number (when the number is bigger than 1.0) or as a percentage (eg 0.01 is 1% and 1.0 is 100%). Frequency is calculated per segment. Percentages are based on the number of docs which have a value for the field, as opposed to all docs in the segment.

Small segments can be excluded completely by specifying the minimum number of docs that the segment should contain with min_segment_size

https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#field-data-filtering

type WithFields

type WithFields interface {
	// Fields, also known as Multi-fields, allow the same string value to be
	// indexed in multiple ways for different purposes, such as one field for
	// search and a multi-field for sorting and aggregations, or the same string
	// value analyzed by different analyzers.
	Fields() Fields
	// SetFields sets the Fields value to v
	SetFields(v Fields) error
}

WithFields is a mixin that adds the fields param

It is often useful to index the same field in different ways for different purposes. This is the purpose of multi-fields. For instance, a string field could be mapped as a text field for full-text search, and as a keyword field for sorting or aggregations

https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html

type WithFormat

type WithFormat interface {
	// The date format(s) that can be parsed. Defaults to
	//   "strict_date_optional_time||epoch_millis."
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html
	Format() string
	// SetFormat sets the format to v
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html
	SetFormat(v string)
}

WithFormat is a type with a format parameter

https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html

type WithFuzziness

type WithFuzziness interface {
	// Fuzziness is the maximum edit distance allowed for matching.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness
	Fuzziness() string
	// SetFuzziness sets the FuzzinessValue to v
	SetFuzziness(str string)
	// FuzzyRewrite is the method used to rewrite the query. See the rewrite
	// parameter for valid values and more information.
	//
	// If the fuzziness parameter is not 0, the match query uses a fuzzy_rewrite
	// method of top_terms_blended_freqs_${max_expansions} by default.
	FuzzyRewrite() Rewrite
	// SetFuzzyRewrite sets the value of FuzzyRewrite to v
	SetFuzzyRewrite(v Rewrite) error
	DefaultFuzzyRewrite() Rewrite // Rewrite
}

WithFuzziness is an interface for queries with fuzziness the parameter

Maximum edit distance allowed for matching. See Fuzziness for valid values and more information.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

type WithFuzzyMaxExpansions

type WithFuzzyMaxExpansions interface {
	// FuzzyMaxExpansions is the maximum number of variations created. Defaults to 50.
	FuzzyMaxExpansions() int
	// SetFuzzyMaxExpansions sets the max_expansions param
	//
	// Maximum number of variations created. Defaults to 50.
	//
	// Warning
	//
	// Avoid using a high value in the max_expansions parameter, especially if the
	// prefix_length parameter value is 0. High values in the max_expansions
	// parameter can cause poor performance due to the high number of variations
	// examined.
	SetFuzzyMaxExpansions(v interface{}) error
}

WithFuzzyMaxExpansions is a query with the max_expansions param

Maximum number of variations created. Defaults to 50.

Warning

Avoid using a high value in the max_expansions parameter, especially if the prefix_length parameter value is 0. High values in the max_expansions parameter can cause poor performance due to the high number of variations examined.

type WithFuzzyPrefixLength

type WithFuzzyPrefixLength interface {
	FuzzyPrefixLength() int
	SetFuzzyPrefixLength(v interface{}) error
}

type WithFuzzyTranspositions

type WithFuzzyTranspositions interface {
	// FuzzyTranspositions edits for fuzzy matching include transpositions of
	// two adjacent characters (ab → ba). Defaults to true
	FuzzyTranspositions() bool
	// SetFuzzyTranspositions sets FuzzyTranspositions to v
	SetFuzzyTranspositions(v interface{}) error
}

WithFuzzyTranspositions is a query with the fuzzy_transpositions param

If true, edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). Defaults to true

type WithIgnoreAbove

type WithIgnoreAbove interface {
	// IgnoreAbove signiall to not index any string longer than this value.
	// Defaults to 2147483647 so that all values would be accepted. Please
	// however note that default dynamic mapping rules create a sub keyword
	// field that overrides this default by setting ignore_above: 256.
	IgnoreAbove() float64
	// SetIgnoreAbove sets the IgnoreAbove value to v
	SetIgnoreAbove(v interface{}) error
}

WithIgnoreAbove is a mapping the ignore_above parameter

Strings longer than the ignore_above setting will not be indexed or stored. For arrays of strings, ignore_above will be applied for each array element separately and string elements longer than ignore_above will not be indexed or stored.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-above.html

type WithIgnoreMalformed

type WithIgnoreMalformed interface {
	// IgnoreMalformed determines if malformed numbers are ignored. If true,
	// malformed numbers are ignored. If false (default), malformed numbers
	// throw an exception and reject the whole document.
	IgnoreMalformed() bool
	// SetIgnoreMalformed sets IgnoreMalformed to v
	SetIgnoreMalformed(v interface{}) error
}

WithIgnoreMalformed is a mapping with the ignore_malformed parameter

Sometimes you don’t have much control over the data that you receive. One user may send a login field that is a date, and another sends a login field that is an email address.

Trying to index the wrong data type into a field throws an exception by default, and rejects the whole document. The ignore_malformed parameter, if set to true, allows the exception to be ignored. The malformed field is not indexed, but other fields in the document are processed normally.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html

type WithIgnoreZValue

type WithIgnoreZValue interface {
	// IgnoreZValue determines whether three dimension points will be indexed.
	//
	// If true (default) three dimension points will be accepted (stored in
	// source) but only latitude and longitude values will be indexed; the third
	// dimension is ignored. If false, geo-points containing any more than
	// latitude and longitude (two dimensions) values throw an exception and
	// reject the whole document.
	IgnoreZValue() bool
	// SetIgnoreZValue sets the IgnoreZValue Value to v
	SetIgnoreZValue(v interface{}) error
}

WithIgnoreZValue is a mapping with the ignore_z_value parameter

If IgnoreZValue is true (default) three dimension points will be accepted (stored in source) but only latitude and longitude values will be indexed; the third dimension is ignored. If false, geo-points containing any more than latitude and longitude (two dimensions) values throw an exception and reject the whole document.

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html#geo-point-params

type WithIncludeInParent

type WithIncludeInParent interface {
	// IncludeInParent (Optional, Boolean) If true, all fields in the nested
	// object are also added to the parent document as standard (flat) fields.
	// Defaults to false.
	IncludeInParent() bool
	// SetIncludeInParent sets the IncludeInParent Value to v
	SetIncludeInParent(v interface{}) error
}

WithIncludeInParent is a mapping with the include_in_parent parameter

(Optional, Boolean) If true, all fields in the nested object are also added to the parent document as standard (flat) fields. Defaults to false.

https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html#nested-params

type WithIncludeInRoot

type WithIncludeInRoot interface {
	// IncludeInRoot deteremines if all fields in the nested object are also
	// added to the root document as standard (flat) fields. Defaults to false
	IncludeInRoot() bool
	// SetIncldueInRoot sets the IncludeInRoot Value to v
	SetIncludeInRoot(v interface{}) error
}

WithIncludeInRoot is a mapping with the include_in_root parameter

(Optional, Boolean) If true, all fields in the nested object are also added to the root document as standard (flat) fields. Defaults to false

https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html#nested-params

type WithIndex

type WithIndex interface {
	Index() bool
	SetIndex(v interface{}) error
}

WithIndex is a mapping with index parameter

The index parameter controls whether field values are indexed. It accepts true or false and defaults to true. Fields that are not indexed are not queryable.

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html

type WithIndexOptions

type WithIndexOptions interface {
	//IndexOptions parameter controls what information is added to the inverted
	//index for search and highlighting purposes.
	IndexOptions() IndexOptions
	// SetIndexOptions sets IndexOptions value to v
	SetIndexOptions(v IndexOptions) error
}

WithIndexOptions is a mapping wit the index_options parameter

The index_options parameter controls what information is added to the inverted index for search and highlighting purposes.

"docs"

Only the doc number is indexed. Can answer the question Does this term exist in this field?

"freqs"

Doc number and term frequencies are indexed. Term frequencies are used to score repeated terms higher than single terms.

"positions" (default)

Doc number, term frequencies, and term positions (or order) are indexed. Positions can be used for proximity or phrase queries.

"offsets"

Doc number, term frequencies, positions, and start and end character offsets (which map the term back to the original string) are indexed. Offsets are used by the unified highlighter to speed up highlighting.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-options.html

type WithIndexPhrases

type WithIndexPhrases interface {
	// IndexPhrases is a param that if enabled, two-term word combinations
	// (shingles) are indexed into a separate field. This allows exact phrase
	// queries (no slop) to run more efficiently, at the expense of a larger index.
	//
	// Note that this works best when stopwords are not removed, as phrases
	// containing stopwords will not use the subsidiary field and will fall back to
	// a standard phrase query. Accepts true or false (default).
	IndexPhrases() bool
	// SetIndexPhrases sets the IndexPhrases value to v
	SetIndexPhrases(v interface{}) error
}

WithIndexPhrases is a mapping with the index_phrases parameter

If IndexPhrases parameter is enabled, two-term word combinations (shingles) are indexed into a separate field. This allows exact phrase queries (no slop) to run more efficiently, at the expense of a larger index. Note that this works best when stopwords are not removed, as phrases containing stopwords will not use the subsidiary field and will fall back to a standard phrase query. Accepts true or false (default).

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-phrases.html#index-phrases

type WithIndexPrefixes

type WithIndexPrefixes interface {
	IndexPrefixes() *IndexPrefixes
	SetIndexPrefixes(v *IndexPrefixes) error
}

WithIndexPrefixes is a mapping with the index_prefixes parameter

The index_prefixes parameter enables the indexing of term prefixes to speed up prefix searches. It accepts the following optional settings

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-prefixes.html

type WithLenient

type WithLenient interface {
	// Lenient determines whether format-based errors, such as providing a text
	// query value for a numeric field, are ignored. Defaults to false.
	Lenient() bool
	// SetLenient sets Lenient to v
	SetLenient(v bool)
}

WithLenient is a query with the lenient param

Lenient determines whether format-based errors, such as providing a text query value for a numeric field, are ignored. Defaults to false.

type WithMaxBoost

type WithMaxBoost interface {
	MaxBoost() float64
	SetMaxBoost(v float64)
}

type WithMaxDeterminizedStates

type WithMaxDeterminizedStates interface {
	MaxDeterminizedStates() int
	SetMaxDeterminizedStates(v interface{}) error
}

type WithMaxExpansions

type WithMaxExpansions interface {
	// MaxExpansions is the maximum number of variations created. Defaults to 50.
	MaxExpansions() int
	// SetMaxExpansions sets the max_expansions param
	//
	// Maximum number of variations created. Defaults to 50.
	//
	// Warning
	//
	// Avoid using a high value in the max_expansions parameter, especially if the
	// prefix_length parameter value is 0. High values in the max_expansions
	// parameter can cause poor performance due to the high number of variations
	// examined.
	SetMaxExpansions(v interface{}) error
}

WithMaxExpansions is a query with the max_expansions param

Maximum number of variations created. Defaults to 50.

Warning

Avoid using a high value in the max_expansions parameter, especially if the prefix_length parameter value is 0. High values in the max_expansions parameter can cause poor performance due to the high number of variations examined.

type WithMaxGaps

type WithMaxGaps interface {
	MaxGaps() int
	SetMaxGaps(maxGaps interface{}) error
}

type WithMaxInputLength

type WithMaxInputLength interface {
	// MaxInputLength limits the length of a single input, defaults to 50 UTF-16
	// code points. This limit is only used at index time to reduce the total
	// number of characters per input string in order to prevent massive inputs
	// from bloating the underlying datastructure. Most use cases won’t be
	// influenced by the default value since prefix completions seldom grow
	// beyond prefixes longer than a handful of characters.
	MaxInputLength() int

	// SetMaxInputLength sets the MaxInputLength value to v
	SetMaxInputLength(v interface{}) error
}

WithMaxInputLength is a mapping with the max_input_length parameter

Limits the length of a single input, defaults to 50 UTF-16 code points. This limit is only used at index time to reduce the total number of characters per input string in order to prevent massive inputs from bloating the underlying datastructure. Most use cases won’t be influenced by the default value since prefix completions seldom grow beyond prefixes longer than a handful of characters.

type WithMaxShingleSize

type WithMaxShingleSize interface {
	// MaxShingleSize is the largest shingle size to create. Valid values are 2
	// (inclusive) to 4 (inclusive). Defaults to 3.
	MaxShingleSize() int
	// SetMaxShingleSize sets the MaxShingleSize to v
	//
	// Valid values are 2 (inclusive) to 4 (inclusive). Defaults to 3.
	SetMaxShingleSize(v int) error
}

WithMaxShingleSize is a mapping with the max_shingle_size parameter

(Optional, integer) Largest shingle size to create. Valid values are 2 (inclusive) to 4 (inclusive). Defaults to 3.

A subfield is created for each integer between 2 and this value. For example, a value of 3 creates two subfields: my_field._2gram and my_field._3gram

More subfields enables more specific queries but increases index size.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-as-you-type.html#specific-params

type WithMeta

type WithMeta interface {
	Meta() Meta
	SetMeta(Meta) error
}

WithMeta is a mapping with the meta parameter

Meta is metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-field-meta.html#mapping-field-meta

type WithMinScore

type WithMinScore interface {
	MinScore() float64
	SetMinScore(v float64)
}

type WithMinimumShouldMatch

type WithMinimumShouldMatch interface {
	MinimumShouldMatch() string
	SetMinimumShouldMatch(v string)
}

WithMinimumShouldMatch is a query with the minimum_should_match param

Examples of possible values:

"3"

Integers indicate a fixed value regardless of the number of optional clauses.

"-2"

Negative integers indicate that the total number of optional clauses, minus this number should be mandatory

"75%"

Percentages indicate that this percent of the total number of optional clauses are necessary. The number computed from the percentage is rounded down and used as the minimum.

"-25%"

Negative percentages indicate that this percent of the total number of optional clauses can be missing. The number computed from the percentage is rounded down, before being subtracted from the total to determine the minimum.

"3<90%"

A positive integer, followed by the less-than symbol, followed by any of the previously mentioned specifiers is a conditional specification. It indicates that if the number of optional clauses is equal to (or less than) the integer, they are all required, but if it’s greater than the integer, the specification applies. In this example: if there are 1 to 3 clauses they are all required, but for 4 or more clauses only 90% are required.

"2<-25% 9<-3"

Multiple conditional specifications can be separated by spaces, each one only being valid for numbers greater than the one before it. In this example: if there are 1 or 2 clauses both are required, if there are 3-9 clauses all but 25% are required, and if there are more than 9 clauses, all but three are required.

Note

When dealing with percentages, negative values can be used to get different behavior in edge cases. 75% and -25% mean the same thing when dealing with 4 clauses, but when dealing with 5 clauses 75% means 3 are required, but -25% means 4 are required.

If the calculations based on the specification determine that no optional clauses are needed, the usual rules about BooleanQueries still apply at search time (a BooleanQuery containing no required clauses must still match at least one optional clause)

No matter what number the calculation arrives at, a value greater than the number of optional clauses, or a value less than 1 will never be used. (ie: no matter how low or how high the result of the calculation result is, the minimum number of required matches will never be lower than 1 or greater than the number of clauses.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html

type WithModifier

type WithModifier interface {
	SetModifier(m Modifier) error
	Modifier() Modifier
}

type WithName

type WithName interface {
	Name() string
	SetName(string)
}

WithName is a rule / query that has the _name parameter

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html#named-queries

type WithNegativeBoost

type WithNegativeBoost interface {
	// Floating point number between 0 and 1.0 used to
	// decrease the relevance scores of documents matching the negative query. (Required, float)
	NegativeBoost() float64
	// Sets negative_boost param
	SetNegativeBoost(negativeBoost interface{}) error
}

type WithNormalizer

type WithNormalizer interface {
	// Normalizer property of keyword fields is similar to analyzer except that it
	// guarantees that the analysis chain produces a single token.
	Normalizer() string
	// SetNormalizer sets the Normalizer value to v
	//
	// The normalizer property of keyword fields is similar to analyzer except that
	// it guarantees that the analysis chain produces a single token.
	SetNormalizer(v string)
}

WithNormalizer is a mixin that adds the normalizer parameter

The normalizer property of keyword fields is similar to analyzer except that it guarantees that the analysis chain produces a single token.

The normalizer is applied prior to indexing the keyword, as well as at search-time when the keyword field is searched via a query parser such as the match query or via a term-level query such as the term query.

A simple normalizer called lowercase ships with elasticsearch and can be used. Custom normalizers can be defined as part of analysis settings

https://www.elastic.co/guide/en/elasticsearch/reference/current/normalizer.html

type WithNorms

type WithNorms interface {
	// Whether field-length should be taken into account when scoring queries.
	// Accepts true (default) or false.
	Norms() bool
	// SetNorms sets the Norms value to v
	SetIndexPhrases(v interface{}) error
}

WithNorms is a mapping with the Norms parameter

Norms store various normalization factors that are later used at query time in order to compute the score of a document relatively to a query.

Although useful for scoring, norms also require quite a lot of disk (typically in the order of one byte per document per field in your index, even for documents that don’t have this specific field). As a consequence, if you don’t need scoring on a specific field, you should disable norms on that field. In particular, this is the case for fields that are used solely for filtering or aggregations.

Norms can be disabled (but not reenabled after the fact)

If updating the norms via the REST API, they will not be removed instantly, but will be removed as old segments are merged into new segments as you continue indexing new documents. Any score computation on a field that has had norms removed might return inconsistent results since some documents won’t have norms anymore while other documents might still have norms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/norms.html

type WithNullValue

type WithNullValue interface {
	// NullValue parameter allows you to replace explicit null values with the
	// specified value so that it can be indexed and searched
	NullValue() interface{}
	// SetNullValue sets the NullValue value to v
	SetNullValue(v interface{})
}

WithNullValue is a mapping with the null_value parameter

A null value cannot be indexed or searched. When a field is set to null, (or an empty array or an array of null values) it is treated as though that field has no values.

The null_value parameter allows you to replace explicit null values with the specified value so that it can be indexed and searched

The null_value needs to be the same data type as the field. For instance, a long field cannot have a string null_value.

https://www.elastic.co/guide/en/elasticsearch/reference/current/null-value.html

type WithOperator

type WithOperator interface {
	// Operator is the boolean logic used to interpret text in the query value.
	// Defaults to Or
	Operator() Operator
	// SetOperator sets the Operator to v
	SetOperator(v Operator) error
}

WithOperator is a query with the operator param

Boolean logic used to interpret text in the query value.

type WithOrdered

type WithOrdered interface {
	Ordered() bool
	SetOrdered(ordered interface{}) error
}

type WithOrientation

type WithOrientation interface {

	// Orientation is the vertex order for the shape’s coordinates list.
	//
	// Defaults to OrientationRight (RIGHT) to comply with OGC standards. OGC
	// standards define outer ring vertices in counterclockwise order with inner
	// ring (hole) vertices in clockwise order.
	Orientation() Orientation
	// SetOrientation sets the Orientation Value to v
	SetOrientation(v Orientation) error
}

WithOrientation is a mapping with the orientation parameter

type WithPhraseSlop

type WithPhraseSlop interface {
	PhraseSlop() int
	SetPhraseSlop(v interface{}) error
}

type WithPositionIncrementGap

type WithPositionIncrementGap interface {
	// PositionIncrementGap is the number of fake term position which should be
	// inserted between each element of an array of strings. Defaults to the
	// position_increment_gap configured on the analyzer which defaults to 100.
	// 100 was chosen because it prevents phrase queries with reasonably large
	// slops (less than 100) from matching terms across field values.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/position-increment-gap.html
	PositionIncrementGap() int
	// SetPositionIncrementGap sets the PositionIncrementGap Value to v
	SetPositionIncrementGap(v interface{}) error
}

WithPositionIncrementGap is a mapping with the position_increment_gap parameter

Analyzed text fields take term positions into account, in order to be able to support proximity or phrase queries. When indexing text fields with multiple values a "fake" gap is added between the values to prevent most phrase queries from matching across the values. The size of this gap is configured using position_increment_gap and defaults to 100.

https://www.elastic.co/guide/en/elasticsearch/reference/current/position-increment-gap.html

type WithPositiveScoreImpact

type WithPositiveScoreImpact interface {
	// PositiveScoreImpact is used by rank_feature queries to modify the scoring
	// formula in such a way that the score increases or decreases the value of
	// the feature
	PositiveScoreImpact() bool
	// SetPositiveScoreImpact sets the PositiveScoreImpact Value to v
	SetPositiveScoreImpact(v interface{}) error
}

WithPositiveScoreImpact is a mapping with the positive_score_impact parameter Rank features that correlate negatively with the score should set positive_score_impact to false (defaults to true). This will be used by the rank_feature query to modify the scoring formula in such a way that the score decreases with the value of the feature instead of increasing. For instance in web search, the url length is a commonly used feature which correlates negatively with scores.

https://www.elastic.co/guide/en/elasticsearch/reference/current/rank-feature.html

type WithPrefixLength

type WithPrefixLength interface {
	PrefixLength() int
	SetPrefixLength(v interface{}) error
}

WithPrefixLength is an interface for a type with the PrefixLength and SetPrefixLength methods

PrefixLength is the umber of beginning characters left unchanged when fuzzy matching. Defaults to 0.

type WithPreservePositionIncrements

type WithPreservePositionIncrements interface {
	// PreservePositionIncrements enables position increments, defaults to true.
	// If disabled and using stopwords analyzer, you could get a field starting
	// with The Beatles, if you suggest for b. Note: You could also achieve this
	// by indexing two inputs, Beatles and The Beatles, no need to change a
	// simple analyzer, if you are able to enrich your data.
	PreservePositionIncrements() bool
	// SetPreservePositionIncrements sets the PreservePositionIncrements value
	// to V
	SetPreservePositionIncrements(v bool)
}

WithPreservePositionIncrements is a mapping with the preserve_position_increments parameter

Enables position increments, defaults to true. If disabled and using stopwords analyzer, you could get a field starting with The Beatles, if you suggest for b. Note: You could also achieve this by indexing two inputs, Beatles and The Beatles, no need to change a simple analyzer, if you are able to enrich your data.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester

type WithPreserveSeperators

type WithPreserveSeperators interface {
	// PreserveSeperators preserves the separators, defaults to true. If
	// disabled, you could find a field starting with Foo Fighters, if you
	// suggest for foof.
	PreserveSeperators() bool
	// SetPreserveSeperators sets the PreserveSeperatorParam value to v
	SetPreserveSeperators(v interface{}) error
}

WithPreserveSeperators is a mapping with the preserve_seperators parameter

Preserves the separators, defaults to true. If disabled, you could find a field starting with Foo Fighters, if you suggest for foof.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester

type WithProperties

type WithProperties interface {
	// Properties are fields within the object, which can be of any data type,
	// including object. New properties may be added to an existing object.
	Properties() Fields
	// SetProperties sets the Properties value to v
	SetProperties(v FieldMap) error
}

WithProperties is a mixin that adds the properties param

Type mappings, object fields and nested fields contain sub-fields, called properties. These properties may be of any data type, including object and nested. Properties can be added:

- explicitly by defining them when creating an index. - explicitly by defining them when adding or updating a mapping type with the PUT mapping API. - dynamically just by indexing documents containing new fields.

https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html

type WithQUoteFieldSuffix

type WithQUoteFieldSuffix interface {
	QuoteFieldSuffix() string
	SetQuoteFieldSuffix(quoteFieldSuffix string)
}

type WithQuoteAnalyzer

type WithQuoteAnalyzer interface {

	// QuoteAnalyzer setting allows you to specify an analyzer for
	// phrases, this is particularly useful when dealing with disabling stop
	// words for phrase queries.
	QuoteAnalyzer() string
	// SetQuoteAnalyzer sets QuoteAnalyzer to v
	SetQuoteAnalyzer(v string)
}

type WithRelation

type WithRelation interface {
	Relation() Relation
	SetRelation(v Relation) error
}

type WithRelations

type WithRelations interface {
	Relations() Relations
	SetRelations(v Relations)
}

WithRelations is a mapping with a relations parameter

The relations section defines a set of possible relations within the documents, each relation being a parent name and a child name.

https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html

type WithRewrite

type WithRewrite interface {
	Rewrite() Rewrite
	SetRewrite(v Rewrite) error
}

WithRewrite is a query with the rewrite param

type WithRuleFilter

type WithRuleFilter interface {
	Filter() *RuleFilter
	SetFilter(rf RuleFilterer) error
}

type WithScalingFactor

type WithScalingFactor interface {
	ScalingFactor() float64
	SetScalingFactor(v interface{})
}

WithScalingFactor is a mapping with the scaling_factor param

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html#scaled-float-params

type WithScoreMode

type WithScoreMode interface {
	SetScoreMode(sm ScoreMode) error
	ScoreMode() ScoreMode
}

type WithSearchAnalyzer

type WithSearchAnalyzer interface {
	// SearchAnalyzer overrides Analyzer for search analysis
	SearchAnalyzer() string
	// SetSearchAnalyzer sets SearchAnalyzer to v
	SetSearchAnalyzer(v string)
}

type WithSearchQuoteAnalyzer

type WithSearchQuoteAnalyzer interface {

	// SearchQuoteAnalyzer setting allows you to specify an analyzer for
	// phrases, this is particularly useful when dealing with disabling stop
	// words for phrase queries.
	SearchQuoteAnalyzer() string
	// SetSearchQuoteAnalyzer sets SearchQuoteAnalyzer to v
	SetSearchQuoteAnalyzer(v string)
}

type WithSimilarity

type WithSimilarity interface {
	// Similarity is mostly useful for text fields, but can also apply to other
	// field types.
	Similarity() Similarity
	// SetSimilarity sets the similarity param to v
	SetSimilarity(v Similarity) error
}

WithSimilarity is a mapping with the similarity parameter

Elasticsearch allows you to configure a scoring algorithm or similarity per field. The similarity setting provides a simple way of choosing a similarity algorithm other than the default BM25, such as TF/IDF.

Similarities are mostly useful for text fields, but can also apply to other field types.

Custom similarities can be configured by tuning the parameters of the built-in similarities. For more details about this expert options, see the similarity module.

The only similarities which can be used out of the box, without any further configuration are:

"BM25"

The Okapi BM25 algorithm. The algorithm used by default in Elasticsearch and Lucene.

"classic" (deprecated)

TF/IDF algorithm, the former default in Elasticsearch and Lucene.

"boolean"

A simple boolean similarity, which is used when full-text ranking is not needed and the score should only be based on whether the query terms match or not. Boolean similarity gives terms a score equal to their query boost.

https://www.elastic.co/guide/en/elasticsearch/reference/current/similarity.html

type WithSlop

type WithSlop interface {
	Slop() int
	SetSlop(v interface{}) error
}

type WithSplitQueriesOnWhitespace

type WithSplitQueriesOnWhitespace interface {
	// SplitQueriesOnWhitespace determines whether full text queries should
	// split the input on whitespace when building a query for this field.
	// Accepts true or false (default).
	SplitQueriesOnWhitespace() bool
	// SetSplitQueriesOnWhitespace sets the SplitQueriesOnWhitespace Value to v
	SetSplitQueriesOnWhitespace(v interface{}) error
}

WithSplitQueriesOnWhitespace is mapping with the split_queries_on_whitespace parameter

split_queries_on_whitespace determines whether full text queries should split the input on whitespace when building a query for this field. Accepts true or false (default).

type WithStore

type WithStore interface {
	Store() bool
	SetStore(v interface{}) error
}

WithStore is a mapping with a store paramter.

By default, field values are indexed to make them searchable, but they are not stored. This means that the field can be queried, but the original field value cannot be retrieved.

Usually this doesn’t matter. The field value is already part of the _source field, which is stored by default. If you only want to retrieve the value of a single field or of a few fields, instead of the whole _source, then this can be achieved with source filtering.

In certain situations it can make sense to store a field. For instance, if you have a document with a title, a date, and a very large content field, you may want to retrieve just the title and the date without having to extract those fields from a large _source field

Stored fields returned as arrays

For consistency, stored fields are always returned as an array because there is no way of knowing if the original field value was a single value, multiple values, or an empty array.

The original value can be retrieved from the _source field instead.

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html

type WithTermVector

type WithTermVector interface {
	// TermVector determines whether term vectors should be stored for the field.
	// Defaults to "no" / TermVectorNone.
	TermVector() TermVector
	// SetTermVector sets the TermVector Value to v
	SetTermVector(v TermVector) error
}

WithTermVector is a mapping with the term_vector parameter

Term vectors contain information about the terms produced by the analysis process, including:

- a list of terms.

- the position (or order) of each term.

- the start and end character offsets mapping the term to its origin in the original string.

- payloads (if they are available) — user-defined binary data associated with each term position.

These term vectors can be stored so that they can be retrieved for a particular document.

WARNING

Setting with_positions_offsets will double the size of a field’s index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/term-vector.html

type WithTieBreaker

type WithTieBreaker interface {
	TieBreaker() float64
	SetTieBreaker(v interface{}) error
}

type WithTimeZone

type WithTimeZone interface {
	TimeZone() string
	SetTimeZone(v string)
}

type WithTranspositions

type WithTranspositions interface {
	// Transpositions indicates whether edits include transpositions of two
	// adjacent characters (ab → ba). Defaults to true.
	Transpositions() bool
	// SetTranspositions sets the value of Transpositions to v
	SetTranspositions(v interface{}) error
}

WithTranspositions is an interface for queries with the transpositions param

(Optional, Boolean) Indicates whether edits include transpositions of two adjacent characters (ab → ba). Defaults to true.

type WithWeight

type WithWeight interface {
	Weight() float64
	SetWeight(v interface{}) error
}

type WithZeroTermsQuery

type WithZeroTermsQuery interface {
	// ZeroTermsQuery indicates  whether no documents are returned if the
	// analyzer removes all tokens, such as when using a stop filter
	ZeroTermsQuery() ZeroTerms
	SetZeroTermsQuery(v ZeroTerms) error
}

type WrapperQuery

type WrapperQuery struct {
	// contains filtered or unexported fields
}

func (*WrapperQuery) Clause

func (q *WrapperQuery) Clause() (QueryClause, error)

func (*WrapperQuery) Clear

func (q *WrapperQuery) Clear()

func (WrapperQuery) Complete

func (WrapperQuery) Complete()

func (*WrapperQuery) IsEmpty

func (q *WrapperQuery) IsEmpty() bool

func (WrapperQuery) Kind

func (WrapperQuery) Kind() QueryKind

func (WrapperQuery) MarshalBSON

func (q WrapperQuery) MarshalBSON() ([]byte, error)

func (WrapperQuery) MarshalJSON

func (q WrapperQuery) MarshalJSON() ([]byte, error)

func (WrapperQuery) Name

func (n WrapperQuery) Name() string

func (*WrapperQuery) SetName

func (n *WrapperQuery) SetName(name string)

func (*WrapperQuery) UnmarshalBSON

func (q *WrapperQuery) UnmarshalBSON(data []byte) error

func (*WrapperQuery) UnmarshalJSON

func (q *WrapperQuery) UnmarshalJSON(data []byte) error

func (*WrapperQuery) Wrapper

func (q *WrapperQuery) Wrapper() (*WrapperQuery, error)

type WrapperQueryParams

type WrapperQueryParams struct {
	Name string
	// contains filtered or unexported fields
}

func (WrapperQueryParams) Clause

func (p WrapperQueryParams) Clause() (QueryClause, error)

func (WrapperQueryParams) Complete

func (WrapperQueryParams) Complete()

func (WrapperQueryParams) Kind

func (WrapperQueryParams) Wrapper

func (p WrapperQueryParams) Wrapper() (*WrapperQuery, error)

type ZeroTerms

type ZeroTerms string
const (
	ZeroTermsUnspecified ZeroTerms = ""
	// ZeroTermsNone - No documents are returned if the analyzer removes all
	// tokens.
	ZeroTermsNone ZeroTerms = "none"
	// ZeroTermsALl - Returns all documents, similar to a match_all query.
	ZeroTermsAll ZeroTerms = "all"
)

func (ZeroTerms) IsEmpty

func (ztq ZeroTerms) IsEmpty() bool

func (ZeroTerms) IsValid

func (ztq ZeroTerms) IsValid() bool

func (ZeroTerms) MarshalJSON

func (ztq ZeroTerms) MarshalJSON() ([]byte, error)

func (ZeroTerms) String

func (ztq ZeroTerms) String() string

func (*ZeroTerms) UnmarshalJSON

func (ztq *ZeroTerms) UnmarshalJSON(data []byte) error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL