You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: update search service to use new search mappings (amundsen-io#1832)
* chore: update search service to use new search mappings
Signed-off-by: Allison Suarez Miranda <[email protected]>
* needed fields back
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated index name to point to new index
Signed-off-by: Allison Suarez Miranda <[email protected]>
* Added deprecation warning log to old ES client
Signed-off-by: Allison Suarez Miranda <[email protected]>
* made fixtures match new mappings for tests
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed other unit ests
Signed-off-by: Allison Suarez Miranda <[email protected]>
* lint
Signed-off-by: Allison Suarez Miranda <[email protected]>
* remove print and import unused
Signed-off-by: Allison Suarez Miranda <[email protected]>
* added docs explaining how to transition to /v2/search
Signed-off-by: Allison Suarez Miranda <[email protected]>
* bit more doc
Signed-off-by: Allison Suarez Miranda <[email protected]>
* change to keep BW compatibility and add new functionality
Signed-off-by: Allison Suarez Miranda <[email protected]>
* a bit of cleanup and comments for clarity
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more cleanup and manual testing of new search
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated all unit tests and initialize proxy classes according to bww comp functionality
Signed-off-by: Allison Suarez Miranda <[email protected]>
* lint
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated docs
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed flake and mypy errors
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more mypy
Signed-off-by: Allison Suarez Miranda <[email protected]>
* sort imports in v3
Signed-off-by: Allison Suarez Miranda <[email protected]>
* implemented most feedback need to do more manual testing and run unit tests + linter
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed import
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated doc
Signed-off-by: Allison Suarez Miranda <[email protected]>
* oops
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fix
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fix mypy issue
Signed-off-by: Allison Suarez Miranda <[email protected]>
* type removed
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more config cleanup and some clarifications
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fix: toggle filter should clear when off (amundsen-io#1848)
* fix: toggle filter should clear when off
Signed-off-by: Allison Suarez Miranda <[email protected]>
* lint fix
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated unit test
Signed-off-by: Allison Suarez Miranda <[email protected]>
* suggestion
Signed-off-by: Allison Suarez Miranda <[email protected]>
* Refactoring various column details and adding type metadata to the table metadata FE model (amundsen-io#1847)
Signed-off-by: Kristen Armes <[email protected]>
* fix: fixes tour not resetting on different pages (amundsen-io#1849)
Signed-off-by: Marcos Iglesias <[email protected]>
* fix: better behavior for search filters (amundsen-io#1852)
* fix: better behavior for application of filters
Signed-off-by: Allison Suarez Miranda <[email protected]>
* explicit comparison to None
Signed-off-by: Allison Suarez Miranda <[email protected]>
* 2nd round of feedback plus more context
Signed-off-by: Allison Suarez Miranda <[email protected]>
* added filters change from different PR and removed deprecated configs
Signed-off-by: Allison Suarez Miranda <[email protected]>
* chore: update search service to use new search mappings
Signed-off-by: Allison Suarez Miranda <[email protected]>
* needed fields back
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated index name to point to new index
Signed-off-by: Allison Suarez Miranda <[email protected]>
* Added deprecation warning log to old ES client
Signed-off-by: Allison Suarez Miranda <[email protected]>
* made fixtures match new mappings for tests
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed other unit ests
Signed-off-by: Allison Suarez Miranda <[email protected]>
* lint
Signed-off-by: Allison Suarez Miranda <[email protected]>
* remove print and import unused
Signed-off-by: Allison Suarez Miranda <[email protected]>
* added docs explaining how to transition to /v2/search
Signed-off-by: Allison Suarez Miranda <[email protected]>
* bit more doc
Signed-off-by: Allison Suarez Miranda <[email protected]>
* change to keep BW compatibility and add new functionality
Signed-off-by: Allison Suarez Miranda <[email protected]>
* a bit of cleanup and comments for clarity
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more cleanup and manual testing of new search
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated all unit tests and initialize proxy classes according to bww comp functionality
Signed-off-by: Allison Suarez Miranda <[email protected]>
* lint
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated docs
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed flake and mypy errors
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more mypy
Signed-off-by: Allison Suarez Miranda <[email protected]>
* sort imports in v3
Signed-off-by: Allison Suarez Miranda <[email protected]>
* implemented most feedback need to do more manual testing and run unit tests + linter
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed import
Signed-off-by: Allison Suarez Miranda <[email protected]>
* updated doc
Signed-off-by: Allison Suarez Miranda <[email protected]>
* oops
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fix
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fix mypy issue
Signed-off-by: Allison Suarez Miranda <[email protected]>
* type removed
Signed-off-by: Allison Suarez Miranda <[email protected]>
* more config cleanup and some clarifications
Signed-off-by: Allison Suarez Miranda <[email protected]>
* 2nd round of feedback plus more context
Signed-off-by: Allison Suarez Miranda <[email protected]>
* added filters change from different PR and removed deprecated configs
Signed-off-by: Allison Suarez Miranda <[email protected]>
* Revert "Merge branch 'asm-search-with-new-mappings' of github.com:amundsen-io/amundsen into asm-search-with-new-mappings"
This reverts commit 49c5c34, reversing
changes made to e14b541.
* fix args kwards
Signed-off-by: Allison Suarez Miranda <[email protected]>
* deprecating config
Signed-off-by: Allison Suarez Miranda <[email protected]>
* deprecating config
Signed-off-by: Allison Suarez Miranda <[email protected]>
* args fix
Signed-off-by: Allison Suarez Miranda <[email protected]>
* readme update
Signed-off-by: Allison Suarez Miranda <[email protected]>
* conf
Signed-off-by: Allison Suarez Miranda <[email protected]>
* flake
Signed-off-by: Allison Suarez Miranda <[email protected]>
* fixed new
Signed-off-by: Allison Suarez Miranda <[email protected]>
* type ignore
Signed-off-by: Allison Suarez Miranda <[email protected]>
* https://peps.python.org/pep-0484/\#arbitrary-argument-lists-and-default-argument-values
Signed-off-by: Allison Suarez Miranda <[email protected]>
* Empty-Commit
Co-authored-by: Kristen Armes <[email protected]>
Co-authored-by: Marcos Iglesias <[email protected]>
Amundsen Search now has a new API `v2` which supports searching all resources indexed in Amundsen and handles filtered and unfiltered search through the `/v2/search` endpoint as opposed to the old endpoints which were defined per resource. This new API also supports updating documents in Elasticsearch through `/v2/document`. The old endpoints relied on the `ElasticsearchProxy` proxy which doesn't support `v2`. The frontend service has been migrated to the `v2` API, so the old search proxy cannot be used with `amundsen-frontend >= 4.0.0`.
4
+
There is `ElasticsearchProxyV2` which supports `v2` and has feature parity with the old API. However this proxy doesn't include any enhancements beyond multi-valued filters with AND/OR logic because further enhancements (like search fuzziness, stemmings, highlighting, etc.)require new mappings to be created by databuilder.
5
+
Finally there is `ElasticsearchProxyV2_1`. This latets proxy supports all new search enhacements that rely on new Elasticsearch mappings and it's also accessible throught `/v2/search` and `/v2/document`. This proxy class is configured by default but it will fall back to `ElasticsearchProxyV2` if it cannot find the new mappings in Elasticsearch.
6
+
7
+
The goal of this tutorial is to explain what the new search functionality offers, how to transition into using `/v2/search` search service endpoint out of the box as well as how to customize it ahead of deprecation of the old search endpoints. The updated search service offers [fuzziness](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness), word [stemming](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/stemming.html), and [boosted search ranking](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/query-dsl-rank-feature-query.html) based on usage.
8
+
9
+
## Elasticsearch Context
10
+
11
+
In order for search to function, metadata for all searchable resources configured is indexed into Elasticsearch with a databuilder task and then Elasticsearch is queried via the search service. In Elasticsearch there are two main concepts that are fundamental to understanding how search works, [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) and [search queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html). Mappings define how fields are indexed into Elasticsearch by specifying the types of fields and how text fields are analyzed. The queries should then be written with the mapping in mind since there certain field types are required to perform certain types of queries efficiently.
12
+
13
+
## Transitioning to `/v2/search`
14
+
15
+
In order to ensure a smooth transition from our previous search functionality to a version which supports these new features follow these steps:
16
+
17
+
### Index Metadata to Elasticsearch Using New Mappings
- Make sure to configure it using a different index alias. So for example if previously the configuration for writing new ES indices was **(A)** for this task **(B)** must be configured instead for each resource.
- This way the previous index is preserved and the new index aliases have the [new mappings](https://github.com/amundsen-io/amundsen/blob/main/databuilder/databuilder/task/search/document_mappings.py) that enable all of the functionality mentioned above.
24
+
- Note this task will use the mappings already provided in this file and default queries to extract metadata from neo4j. Elasticsearch mappings can be customized by extending the mapping classes and configuring the task to use the custom mapping via `MAPPING_CLASS`
25
+
Queries to extract metadata from neo4j can be customized and configured through `CYPHER_QUERY_CONFIG_KEY`.
26
+
3. Run the task.
27
+
4. Verify that your ES mappings match the [new mapping definitions](https://github.com/amundsen-io/amundsen/blob/main/databuilder/databuilder/task/search/document_mappings.py) by running this directly on Elasticsearch.
28
+
-`GET new_table_search_index`
29
+
30
+
### Configuring the Search Service
31
+
32
+
1. Bump to `amundsen-search >= 4.0.0`
33
+
2. Configure the [Elasticsearch ES_PROXY_CLIENT to use ELASTICSEARCH_V2_1](https://github.com/amundsen-io/amundsen/blob/main/search/search_service/config.py#L18), which is enabled by default in the latest version of search unless configured differently.
34
+
- You can customize the search query by providing a custom client. You can create your own client by extending the class from `es_proxy_v2_1.py` (ex: `class MyESClient(ElasticsearchProxyV2_1):`) and overwritting any of the functions provided to change the query.
35
+
3. (OPTIONAL) If the alias your new mappings are indexed under differs from `{resource}_search_index_v2_1` make sure to configure the correct string template by adding `ES_ALIAS_TEMPLATE = 'my_{resource}_search_index_alias'` to the config with your custom alias name.
36
+
37
+
### Use the latest version of Frontend
38
+
1. Make sure you are using `amundsen-frontend >= 4.0.0` which calls the search service `/v2/search` endpoint.
0 commit comments