Skip to content

Commit

Permalink
Set source mode through an index setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrik-es committed Jan 28, 2025
1 parent d5697bd commit 44aea10
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 49 deletions.
6 changes: 1 addition & 5 deletions cohere_vector/index-vectors-only-mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
{% if preload_pagecache %}
"index.store.preload": [ "vec", "vex", "vem"],
{% endif %}
"index.mapping.source.mode": "synthetic",
"index.number_of_shards": {{number_of_shards | default(1)}},
"index.number_of_replicas": {{number_of_replicas | default(0)}}
{%- endif -%}{# non-serverless-index-settings-marker-end #}
},
"mappings": {
"dynamic": false,
{%- if build_flavor != "serverless" -%}
"_source": {
"mode": "synthetic"
},
{%- endif -%}
"properties": {
"emb": {
"type": "dense_vector",
Expand Down
11 changes: 3 additions & 8 deletions elastic/logs/templates/component/track-shared-logsdb-mode.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@
{% if index_mode %}
"index": {
"mode": {{ index_mode | tojson }}
{% if source_mode %}
,"mapping.source.mode": {{ source_mode | tojson }}
{% endif %}
{% if use_synthetic_source_recovery %}
,"recovery.use_synthetic_source": {{use_synthetic_source_recovery | tojson}}
{% endif %}
{% if synthetic_source_keep %}
,"mapping.synthetic_source_keep": {{ synthetic_source_keep | tojson }}
{% endif %}
}
{% endif %}
},
"mappings": {
{% if source_mode %}
"_source": {
"mode": {{ source_mode | tojson }}
}
{% endif %}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{% if index_mode %}
"index": {
"mode": {{ index_mode | tojson }},
{% if source_mode %}
"mapping.source.mode": {{ source_mode | tojson }},
{% endif %}
{% if use_synthetic_source_recovery %}
"recovery.use_synthetic_source": {{use_synthetic_source_recovery | tojson}},
{% endif %}
Expand All @@ -15,13 +18,6 @@
"sort.missing": ["_first", "_last"]
}
{% endif %}
},
"mappings": {
{% if source_mode %}
"_source": {
"mode": {{ source_mode | tojson }}
}
{% endif %}
}
}
}
6 changes: 3 additions & 3 deletions http_logs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
"index.sort.field": ["@timestamp"],
"index.sort.order":["desc"]
{%- endif %}
{% if source_mode %}
,"mapping.source.mode": {{ source_mode | tojson }}
{% endif %}
},
"mappings": {
"dynamic": "strict",
{%- if enable_logsdb %}
{%- else %}
"_source": {
"enabled": {{ source_enabled | default(true) | tojson }}
{% if source_mode %}
"mode": {{ source_mode | tojson }},
{% endif %}
},
{%- endif %}
"properties": {
Expand Down
4 changes: 1 addition & 3 deletions k8s_metrics/templates/metrics-kubernetes.pod@custom.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{%- endif %}
"codec": "best_compression",
"mapping": {
"source.mode": "synthetic",
"total_fields": {
"limit": "10000"
}
Expand Down Expand Up @@ -70,9 +71,6 @@
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"dynamic_templates": [
{
"container.labels": {
Expand Down
4 changes: 1 addition & 3 deletions k8s_metrics/templates/metrics-kubernetes.pod@package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"index": {
"codec": "best_compression",
"mapping": {
"source.mode": "synthetic",
"total_fields": {
"limit": "10000"
}
Expand Down Expand Up @@ -63,9 +64,6 @@
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"dynamic_templates": [
{
"container.labels": {
Expand Down
4 changes: 1 addition & 3 deletions msmarco-v2-vector/index-vectors-only-mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{% if preload_pagecache %}
"store.preload": [ "vec", "vex", "vem"],
{% endif %}
"mapping.source.mode": "synthetic",
"number_of_shards": {{number_of_shards | default(1)}},
"number_of_replicas": {{number_of_replicas | default(0)}}
{% if aggressive_merge_policy %},
Expand All @@ -24,9 +25,6 @@
},
"mappings": {
"dynamic": false,
"_source": {
"mode": "synthetic"
},
"properties": {
"docid": {
"type": "keyword"
Expand Down
7 changes: 2 additions & 5 deletions nyc_taxis/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
"index.number_of_shards": {{number_of_shards | default(1)}},
"index.number_of_replicas": {{number_of_replicas | default(0)}},
{% endif %}
"index.requests.cache.enable": false
"index.requests.cache.enable": false,
{%- endif -%}{# non-serverless-index-settings-marker-end #}
"index.mapping.source.mode": {{ source_mode | default("stored") | tojson }}
},
"mappings": {
"_source": {
"mode": {{ source_mode | default("stored") | tojson }}

},
"properties": {
"surcharge": {
"scaling_factor": 100,
Expand Down
6 changes: 2 additions & 4 deletions random_vector/index-mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
{%- endif -%}{# non-serverless-index-settings-marker-end #}
"sort": {
"field": "partition_id"
}
},
"mapping.source.mode": "synthetic"
}
},
"mappings": {
"_routing": {
"required": true
},
"_source": {
"mode": "synthetic"
},
"properties": {
"partition_id": {
"type": "keyword"
Expand Down
6 changes: 2 additions & 4 deletions tsdb/index-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
{% if synthetic_source_keep %}
"synthetic_source_keep": "{{synthetic_source_keep}}",
{% endif %}
"total_fields.limit": 10000
"total_fields.limit": 10000,
"source.mode": {{ p_source_mode | tojson }}
}
}
},
Expand All @@ -44,9 +45,6 @@
"beat": "metricbeat",
"version": "7.6.2"
},
"_source": {
"mode": {{ p_source_mode | tojson }}
},
"dynamic_templates": [
{
"labels": {
Expand Down
6 changes: 2 additions & 4 deletions tsdb/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
{% if synthetic_source_keep %}
"synthetic_source_keep": "{{synthetic_source_keep}}",
{% endif %}
"total_fields.limit": 10000
"total_fields.limit": 10000,
"source.mode": {{ p_source_mode | tojson }}
}
}
},
Expand All @@ -44,9 +45,6 @@
"beat": "metricbeat",
"version": "7.6.2"
},
"_source": {
"mode": {{ p_source_mode | tojson }}
},
"dynamic_templates": [
{
"labels": {
Expand Down

0 comments on commit 44aea10

Please sign in to comment.