Skip to content

Commit

Permalink
[Elasticsearch] fix: Filters not working with metadata that contain a…
Browse files Browse the repository at this point in the history
… space or capitalization (#639)

* use dynamic template for mapping of additional fields

* explicitly define mapping of content field

* remove redundant path_match
  • Loading branch information
julian-risch authored Apr 3, 2024
1 parent 9b922d6 commit dc590f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,20 @@ def __init__(
# configure mapping for the embedding field
mappings = {
"properties": {
"embedding": {"type": "dense_vector", "index": True, "similarity": embedding_similarity_function}
}
"embedding": {"type": "dense_vector", "index": True, "similarity": embedding_similarity_function},
"content": {"type": "text"},
},
"dynamic_templates": [
{
"strings": {
"path_match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
},
}
}
],
}

# Create the index if it doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def __init__(
"dynamic_templates": [
{
"strings": {
"path_match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
Expand Down

0 comments on commit dc590f2

Please sign in to comment.