|
@@ -0,0 +1,280 @@
|
|
|
+[[ingest-pipeline-search]]
|
|
|
+== Ingest pipelines in Search
|
|
|
+
|
|
|
+You can manage ingest pipelines through Elasticsearch APIs or Kibana UIs.
|
|
|
+
|
|
|
+The *Content* UI under *Search* has a set of tools for creating and managing indices optimized for search use cases (non time series data).
|
|
|
+You can also manage your ingest pipelines in this UI.
|
|
|
+
|
|
|
+[discrete]
|
|
|
+[[ingest-pipeline-search-where]]
|
|
|
+=== Find pipelines in Content UI
|
|
|
+
|
|
|
+To work with ingest pipelines using these UI tools, you'll be using the *Pipelines* tab on your search-optimized Elasticsearch index.
|
|
|
+
|
|
|
+To find this tab in the Kibana UI:
|
|
|
+
|
|
|
+1. Go to *Search > Content > Elasticsearch indices*.
|
|
|
+2. Select the index you want to work with. For example, `search-my-index`.
|
|
|
+3. On the index's overview page, open the *Pipelines* tab.
|
|
|
+4. From here, you can follow the instructions to create custom pipelines, and set up ML inference pipelines.
|
|
|
+
|
|
|
+The tab is highlighted in this screenshot:
|
|
|
+
|
|
|
+[.screenshot]
|
|
|
+image::../images/ingest/ingest-pipeline-ent-search-ui.png[align="center"]
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-in-enterprise-search]
|
|
|
+=== Overview
|
|
|
+
|
|
|
+These tools can be particularly helpful by providing a layer of customization and post-processing of documents.
|
|
|
+For example:
|
|
|
+
|
|
|
+* providing consistent extraction of text from binary data types
|
|
|
+* ensuring consistent formatting
|
|
|
+* providing consistent sanitization steps (removing PII like phone numbers or SSN's)
|
|
|
+
|
|
|
+It can be a lot of work to set up and manage production-ready pipelines from scratch.
|
|
|
+Considerations such as error handling, conditional execution, sequencing, versioning, and modularization must all be taken into account.
|
|
|
+
|
|
|
+To this end, when you create indices for search use cases, (including {enterprise-search-ref}/crawler.html[Elastic web crawler], {enterprise-search-ref}/connectors.html[Elastic connector], and API indices), each index already has a pipeline set up with several processors that optimize your content for search.
|
|
|
+
|
|
|
+This pipeline is called `ent-search-generic-ingestion`.
|
|
|
+While it is a "managed" pipeline (meaning it should not be tampered with), you can view its details via the Kibana UI or the Elasticsearch API.
|
|
|
+You can also <<ingest-pipeline-search-details-generic-reference,read more about its contents below>>.
|
|
|
+
|
|
|
+You can control whether you run some of these processors.
|
|
|
+While all features are enabled by default, they are eligible for opt-out.
|
|
|
+For {enterprise-search-ref}/crawler.html[Elastic crawler] and {enterprise-search-ref}/connectors.html[Elastic connectors], you can opt out (or back in) per index, and your choices are saved.
|
|
|
+For API indices, you can opt out (or back in) by including specific fields in your documents.
|
|
|
+<<ingest-pipeline-search-pipeline-settings-using-the-api,See below for details>>.
|
|
|
+
|
|
|
+At the deployment level, you can change the default settings for all new indices.
|
|
|
+This will not effect existing indices.
|
|
|
+
|
|
|
+Each index also provides the capability to easily create index-specific ingest pipelines with customizable processing.
|
|
|
+If you need that extra flexibility, you can create a custom pipeline by going to your pipeline settings and choosing to "copy and customize".
|
|
|
+This will replace the index's use of `ent-search-generic-ingestion` with 3 newly generated pipelines:
|
|
|
+
|
|
|
+1. `<index-name>`
|
|
|
+2. `<index-name>@custom`
|
|
|
+3. `<index-name>@ml-inference`
|
|
|
+
|
|
|
+Like `ent-search-generic-ingestion`, the first of these is "managed", but the other two can and should be modified to fit your needs.
|
|
|
+You can view these pipelines using the platform tools (Kibana UI, Elasticsearch API), and can also
|
|
|
+<<ingest-pipeline-search-details-specific,read more about their content below>>.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-pipeline-settings]
|
|
|
+=== Pipeline Settings
|
|
|
+
|
|
|
+Aside from the pipeline itself, you have a few configuration options which control individual features of the pipelines.
|
|
|
+
|
|
|
+* **Extract Binary Content** - This controls whether or not binary documents should be processed and any textual content should be extracted.
|
|
|
+* **Reduce Whitespace** - This controls whether or not consecutive, leading, and trailing whitespaces should be removed.
|
|
|
+ This can help to display more content in some search experiences.
|
|
|
+* **Run ML Inference** - Only available on index-specific pipelines.
|
|
|
+ This controls whether or not the optional `<index-name>@ml-inference` pipeline will be run.
|
|
|
+ Enabled by default.
|
|
|
+
|
|
|
+For Elastic web crawler and connectors, you can opt in or out per index.
|
|
|
+These settings are stored in Elasticsearch in the `.elastic-connectors` index, in the document that corresponds to the specific index.
|
|
|
+These settings can be changed there directly, or through the Kibana UI at *Search > Content > Indices > <your index> > Pipelines > Settings*.
|
|
|
+
|
|
|
+You can also change the deployment wide defaults.
|
|
|
+These settings are stored in the Elasticsearch mapping for `.elastic-connectors` in the `_meta` section.
|
|
|
+These settings can be changed there directly, or from the Kibana UI at *Search > Content > Settings* tab.
|
|
|
+Changing the deployment wide defaults will not impact any existing indices, but will only impact any newly created indices defaults.
|
|
|
+Those defaults will still be able to be overriden by the index-specific settings.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-pipeline-settings-using-the-api]
|
|
|
+==== Using the API
|
|
|
+
|
|
|
+These settings are not persisted for indices that "Use the API".
|
|
|
+Instead, changing these settings will, in real time, change the example cURL request displayed.
|
|
|
+Notice that the example document in the cURL request contains three underscore-prefixed fields:
|
|
|
+
|
|
|
+[source,js]
|
|
|
+----
|
|
|
+{
|
|
|
+ ...
|
|
|
+ "_extract_binary_content": true,
|
|
|
+ "_reduce_whitespace": true,
|
|
|
+ "_run_ml_inference": true
|
|
|
+}
|
|
|
+----
|
|
|
+// NOTCONSOLE
|
|
|
+
|
|
|
+Omitting one of these special fields is the same as specifying it with the value `false`.
|
|
|
+
|
|
|
+[NOTE]
|
|
|
+=========================
|
|
|
+You must also specify the pipeline in your indexing request.
|
|
|
+This is also shown in the example cURL request.
|
|
|
+=========================
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+If the pipeline is not specified, the underscore-prefixed fields will actually be indexed, and will not impact any processing behaviors.
|
|
|
+=========================
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details]
|
|
|
+=== Details
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-generic-reference]
|
|
|
+==== `ent-search-generic-ingestion` Reference
|
|
|
+
|
|
|
+You can access this pipeline with the <<get-pipeline-api, Elasticsearch Ingest Pipelines API>> or via Kibana's <<create-manage-ingest-pipelines,Stack Management > Ingest Pipelines>> UI.
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+This pipeline is a "managed" pipeline.
|
|
|
+That means that it is not intended to be edited.
|
|
|
+Editing/updating this pipeline manually could result in unintended behaviors, or difficulty in upgrading in the future.
|
|
|
+If you want to make customizations, we recommend you utilize index-specific pipelines (see below), specifically <<ingest-pipeline-search-details-specific-custom-reference,the `<index-name>@custom` pipeline>>.
|
|
|
+=========================
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-generic-reference-processors]
|
|
|
+===== Processors
|
|
|
+
|
|
|
+1. `attachment` - this uses the <<attachment, Attachment>> processor to convert any binary data stored in a document's `_attachment` field to a nested object of plain text and metadata.
|
|
|
+2. `set_body` - this uses the <<set-processor, Set>> processor to copy any plain text extracted from the previous step and persist it on the document in the `body` field.
|
|
|
+3. `remove_replacement_chars` - this uses the <<gsub-processor, Gsub>> processor to remove characters like "�" from the `body` field.
|
|
|
+4. `remove_extra_whitespace` - this uses the <<gsub-processor, Gsub>> processor to replace consecutive whitespace characters with single spaces in the `body` field.
|
|
|
+ While not perfect for every use case (see below for how to disable), this can ensure that search experiences display more content and highlighting and less empty space for your search results.
|
|
|
+5. `trim` - this uses the <<trim-processor, Trim>> processor to remove any remaining leading or trailing whitespace from the `body` field.
|
|
|
+6. `remove_meta_fields` - this final step of the pipeline uses the <<remove-processor, Remove>> processor to remove special fields that may have been used elsewhere in the pipeline, whether as temporary storage or as control flow parameters.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-generic-reference-params]
|
|
|
+===== Control flow parameters
|
|
|
+
|
|
|
+The `ent-search-generic-ingestion` pipeline does not always run all processors.
|
|
|
+It utilizes a feature of ingest pipelines to <<conditionally-run-processor,conditionally run processors>> based on the contents of each individual document.
|
|
|
+
|
|
|
+* `_extract_binary_content` - if this field is present and has a value of `true` on a source document, the pipeline will attempt to run the `attachment`, `set_body`, and `remove_replacement_chars` processors.
|
|
|
+ Note that the document will also need an `_attachment` field populated with base64-encoded binary data in order for the `attachment` processor to have any output.
|
|
|
+ If the `_extract_binary_content` field is missing or `false` on a source document, these processors will be skipped.
|
|
|
+* `_reduce_whitespace` - if this field is present and has a value of `true` on a source document, the pipeline will attempt to run the `remove_extra_whitespace` and `trim` processors.
|
|
|
+ These processors only apply to the `body` field.
|
|
|
+ If the `_reduce_whitespace` field is missing or `false` on a source document, these processors will be skipped.
|
|
|
+
|
|
|
+Crawler, Native Connectors, and Connector Clients will automatically add these control flow parameters based on the settings in the index's Pipeline tab.
|
|
|
+To control what settings any new indices will have upon creation, see the deployment wide content settings.
|
|
|
+See <<ingest-pipeline-search-pipeline-settings>>.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific]
|
|
|
+==== Index-specific ingest pipelines
|
|
|
+
|
|
|
+In the Kibana UI for your index, by clicking on the Pipelines tab, then *Settings > Copy and customize*, you can quickly generate 3 pipelines which are specific to your index.
|
|
|
+These 3 pipelines replace `ent-search-generic-ingestion` for the index.
|
|
|
+There is nothing lost in this action, as the `<index-name>` pipeline is a superset of functionality over the `ent-search-generic-ingestion` pipeline.
|
|
|
+
|
|
|
+[IMPORTANT]
|
|
|
+====
|
|
|
+The "copy and customize" button is not available at all Elastic subscription levels.
|
|
|
+Refer to the Elastic subscriptions pages for https://www.elastic.co/subscriptions/cloud[Elastic Cloud^] and https://www.elastic.co/subscriptions[self-managed] deployments.
|
|
|
+====
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific-reference]
|
|
|
+===== `<index-name>` Reference
|
|
|
+
|
|
|
+This pipeline looks and behaves a lot like the <<ingest-pipeline-search-details-generic-reference,`ent-search-generic-ingestion` pipeline>>, but with <<ingest-pipeline-search-details-specific-reference-processors,two additional processors>>.
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+You should not rename this pipeline.
|
|
|
+=========================
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+This pipeline is a "managed" pipeline.
|
|
|
+That means that it is not intended to be edited.
|
|
|
+Editing/updating this pipeline manually could result in unintended behaviors, or difficulty in upgrading in the future.
|
|
|
+If you want to make customizations, we recommend you utilize <<ingest-pipeline-search-details-specific-custom-reference,the `<index-name>@custom` pipeline>>.
|
|
|
+=========================
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific-reference-processors]
|
|
|
+====== Processors
|
|
|
+
|
|
|
+In addition to the processors inherited from the <<ingest-pipeline-search-details-generic-reference,`ent-search-generic-ingestion` pipeline>>, the index-specific pipeline also defines:
|
|
|
+
|
|
|
+* `index_ml_inference_pipeline` - this uses the <<pipeline-processor, Pipeline>> processor to run the `<index-name>@ml-inference` pipeline.
|
|
|
+ This processor will only be run if the source document includes a `_run_ml_inference` field with the value `true`.
|
|
|
+* `index_custom_pipeline` - this uses the <<pipeline-processor, Pipeline>> processor to run the `<index-name>@custom` pipeline.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific-reference-params]
|
|
|
+====== Control flow parameters
|
|
|
+
|
|
|
+Like the `ent-search-generic-ingestion` pipeline, the `<index-name>` pipeline does not always run all processors.
|
|
|
+In addition to the `_extract_binary_content` and `_reduce_whitespace` control flow parameters, the `<index-name>` pipeline also supports:
|
|
|
+
|
|
|
+* `_run_ml_inference` - if this field is present and has a value of `true` on a source document, the pipeline will attempt to run the `index_ml_inference_pipeline` processor.
|
|
|
+ If the `_run_ml_inference` field is missing or `false` on a source document, this processor will be skipped.
|
|
|
+
|
|
|
+Crawler, Native Connectors, and Connector Clients will automatically add these control flow parameters based on the settings in the index's Pipeline tab.
|
|
|
+To control what settings any new indices will have upon creation, see the deployment wide content settings.
|
|
|
+See <<ingest-pipeline-search-pipeline-settings>>.
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific-ml-reference]
|
|
|
+===== `<index-name>@ml-inference` Reference
|
|
|
+
|
|
|
+This pipeline is empty to start (no processors), but can be added to via the Kibana UI either through the Pipelines tab of your index, or from the *Stack Management > Ingest Pipelines* page.
|
|
|
+Unlike the `ent-search-generic-ingestion` pipeline and the `<index-name>` pipeline, this pipeline is NOT "managed".
|
|
|
+
|
|
|
+It's possible to add one or more ML inference pipelines to an index in the *Content* UI.
|
|
|
+This pipeline will serve as a container for all of the ML inference pipelines configured for the index.
|
|
|
+Each ML inference pipeline added to the index is referenced within `<index-name>@ml-inference` using a `pipeline` processor.
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+You should not rename this pipeline.
|
|
|
+=========================
|
|
|
+
|
|
|
+[NOTE]
|
|
|
+=========================
|
|
|
+The `monitor_ml` Elasticsearch cluster permission is required in order to manage ML models and ML inference pipelines which use those models.
|
|
|
+=========================
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-details-specific-custom-reference]
|
|
|
+===== `<index-name>@custom` Reference
|
|
|
+
|
|
|
+This pipeline is empty to start (no processors), but can be added to via the Kibana UI either through the Pipelines
|
|
|
+tab of your index, or from the *Stack Management > Ingest Pipelines* page.
|
|
|
+Unlike the `ent-search-generic-ingestion` pipeline and the `<index-name>` pipeline, this pipeline is NOT "managed".
|
|
|
+
|
|
|
+You are encouraged to make additions and edits to this pipeline, provided its name remains the same.
|
|
|
+This provides a convenient hook from which to add custom processing and transformations for your data.
|
|
|
+Be sure to read the <<ingest, docs for ingest pipelines>> to see what options are available.
|
|
|
+
|
|
|
+[WARNING]
|
|
|
+=========================
|
|
|
+You should not rename this pipeline.
|
|
|
+=========================
|
|
|
+
|
|
|
+[discrete#ingest-pipeline-search-upgrading-notes]
|
|
|
+=== Upgrading notes
|
|
|
+
|
|
|
+.Expand to see upgrading notes
|
|
|
+[%collapsible%closed]
|
|
|
+=============
|
|
|
+
|
|
|
+* `app_search_crawler` - Since 8.3, {app-search-crawler} has utilized this pipeline to power its binary content
|
|
|
+extraction.
|
|
|
+ You can read more about this pipeline and its usage in the {app-search-ref}/web-crawler-reference.html#web-crawler-reference-binary-content-extraction[App Search Guide].
|
|
|
+ When upgrading from 8.3 to 8.5+, be sure to note any changes that you made to the `app_search_crawler` pipeline.
|
|
|
+ These changes should be re-applied to each index's `<index-name>@custom` pipeline in order to ensure a consistent data processing experience.
|
|
|
+ In 8.5+, the <<ingest-pipeline-search-pipeline-settings, index setting to enable binary content>> is required *in addition* to the configurations mentioned in the {app-search-ref}/web-crawler-reference.html#web-crawler-reference-binary-content-extraction[App Search Guide].
|
|
|
+
|
|
|
+* `ent_search_crawler` - Since 8.4, the Elastic web crawler has utilized this pipeline to power its binary content extraction.
|
|
|
+ You can read more about this pipeline and its usage in the {enterprise-search-ref}/crawler-managing.html#crawler-managing-binary-content[Elastic web crawler Guide].
|
|
|
+ When upgrading from 8.4 to 8.5+, be sure to note any changes that you made to the `ent_search_crawler` pipeline.
|
|
|
+These changes should be re-applied to each index's `<index-name>@custom` pipeline in order to ensure a consistent data processing experience.
|
|
|
+ In 8.5+, the <<ingest-pipeline-search-pipeline-settings, index setting to enable binary content>> is required *in addition* to the configurations mentioned in the {enterprise-search-ref}/crawler-managing.html#crawler-managing-binary-content[Elastic web crawler Guide].
|
|
|
+
|
|
|
+* `ent-search-generic-ingestion` - Since 8.5, Native Connectors, Connector Clients, and new (>8.4) Elastic web crawler indices will all make use of this pipeline by default.
|
|
|
+ You can <<ingest-pipeline-search-details-generic-reference, read more about this pipeline>> above.
|
|
|
+ As this pipeline is "managed", any modifications that were made to `app_search_crawler` and/or `ent_search_crawler` should NOT be made to `ent-search-generic-ingestion`.
|
|
|
+ Instead, if such customizations are desired, you should utilize <<ingest-pipeline-search-details-specific>>, placing all modifications in the `<index-name>@custom` pipeline(s).
|
|
|
+=============
|
|
|
+
|
|
|
+include::search-inference-processing.asciidoc[]
|
|
|
+include::search-nlp-tutorial.asciidoc[]
|