Перейти к основному содержимому

PaginatedJsonQueryElasticsearch

Описание

Процессор, позволяющий пользователю выполнять постраничный запрос (с агрегациями), написанный с использованием Elasticsearch JSON DSL. Он будет использовать содержимое FlowFile для запроса, если атрибут QUERY не заполнен. Запросы Search After/Point in Time должны включать действительное поле "sort".

Теги

elasticsearch, elasticsearch5, elasticsearch6, elasticsearch7, elasticsearch8, query, scroll, page, read, json

Свойства

НазваниеОписание
Query Definition StyleHow the JSON Query will be defined for use by the processor.
QueryA query in JSON syntax, not Lucene syntax. Ex: {"query":{"match":{"somefield":"somevalue"}}}. If this parameter is not set, the query will be read from the flowfile content. If the query (property and flowfile content) is empty, a default empty JSON Object will be used, which will result in a "match_all" query in Elasticsearch. Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "FULL_QUERY".
Query ClauseA "query" clause in JSON syntax, not Lucene syntax. Ex: {"match":{"somefield":"somevalue"}}. If the query is empty, a default JSON Object will be used, which will result in a "match_all" query in Elasticsearch. Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
SizeThe maximum number of documents to retrieve in the query. If the query is paginated, this "size" applies to each page of the query, not the "size" of the entire result set. Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
SortSort results by one or more fields, in JSON syntax. Ex: [{"price" : {"order" : "asc", "mode" : "avg"}}, {"post_date" : {"format": "strict_date_optional_time_nanos"}}] Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
AggregationsOne or more query aggregations (or "aggs"), in JSON syntax. Ex: {"items": {"terms": {"field": "product", "size": 10}}} Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
FieldsFields of indexed documents to be retrieved, in JSON syntax. Ex: ["user.id", "http.response.*", {"field": "@timestamp", "format": "epoch_millis"}] Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
Script FieldsFields to created using script evaluation at query runtime, in JSON syntax. Ex: {"test1": {"script": {"lang": "painless", "source": "doc['price'].value * 2"}}, "test2": {"script": {"lang": "painless", "source": "doc['price'].value * params.factor", "params": {"factor": 2.0}}}} Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)This Property is only considered if the [Query Definition Style] Property has a value of "BUILD_QUERY".
Query AttributeIf set, the executed query will be set on each result flowfile in the specified attribute. Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)
IndexThe name of the index to use. Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)
TypeThe type of this document (used by Elasticsearch for indexing and searching). Поддерживает язык выражений: true (будет оцениваться с использованием атрибутов файла потока и переменных среды)
Max JSON Field String LengthThe maximum allowed length of a string value when parsing a JSON document or attribute.
Client ServiceAn Elasticsearch client service to use for running queries.
Search Results SplitВыводит файл потока, содержащий все результаты поиска, или один файл потока для каждого отдельного результата поиска, или один файл потока, содержащий все результаты поиска из всех постраничных ответов.
Search Results FormatФормат вывода результатов поиска.
Aggregation Results SplitВыводит файл потока, содержащий все агрегации, или по одному файлу потока для каждой отдельной агрегации.
Aggregation Results FormatФормат результатов агрегации.
Output No HitsOutput a "hits" flowfile even if no hits found for query. If true, an empty "hits" flowfile will be output even if "aggregations" are output.
Pagination TypeИспользуемый метод разбиения на страницы. Не все типы доступны для всех версий Elasticsearch. Ознакомьтесь с документацией Elasticsearch, чтобы узнать, какие типы применимы и рекомендуются для вашего сервиса.
Pagination Keep AlivePagination "keep_alive" period. Period Elasticsearch will keep the scroll/pit cursor alive in between requests (this is not the time expected for all pages to be returned, but the maximum allowed time for requests between page retrievals).

Взаимосвязи

  • hits: Результаты поиска направляются в эту связь.
  • original: Все исходные файлы потока, которые не вызывают ошибок, направляются в эту связь.
  • failure: All flowfiles that fail for reasons unrelated to server availability go to this relationship.
  • aggregations: Агрегации направляются в эту связь.