Skip to content

Commit

Permalink
[Enterprise Search] Add replica settings to connectors indices (#138796)
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse authored Aug 15, 2022
1 parent 99ea41c commit 68130f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Setup Indices', () => {
},
properties: {
completed_at: { type: 'date' },
connector: connectorsMappings.properties,
connector: { properties: connectorsMappings.properties },
connector_id: {
type: 'keyword',
},
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('Setup Indices', () => {
expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalledWith({
index: connectorsIndexName,
mappings: connectorsMappings,
settings: { hidden: true },
settings: { auto_expand_replicas: '0-3', hidden: true, number_of_replicas: 0 },
});
expect(mockClient.asCurrentUser.indices.updateAliases).toHaveBeenCalledWith({
actions: [
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('Setup Indices', () => {
expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalledWith({
index: jobsIndexName,
mappings: connectorsJobsMappings,
settings: { hidden: true },
settings: { auto_expand_replicas: '0-3', hidden: true, number_of_replicas: 0 },
});
expect(mockClient.asCurrentUser.indices.updateAliases).toHaveBeenCalledWith({
actions: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ const connectorMappingsProperties: Record<string, MappingProperty> = {
sync_now: { type: 'boolean' },
};

const defaultSettings: IndicesIndexSettings = {
auto_expand_replicas: '0-3',
hidden: true,
number_of_replicas: 0,
};

const indices: IndexDefinition[] = [
{
aliases: ['.elastic-connectors'],
Expand All @@ -63,9 +69,7 @@ const indices: IndexDefinition[] = [
properties: connectorMappingsProperties,
},
name: '.elastic-connectors-v1',
settings: {
hidden: true,
},
settings: defaultSettings,
},
{
aliases: ['.elastic-connectors-sync-jobs'],
Expand All @@ -75,7 +79,7 @@ const indices: IndexDefinition[] = [
},
properties: {
completed_at: { type: 'date' },
connector: connectorMappingsProperties,
connector: { properties: connectorMappingsProperties },
connector_id: {
type: 'keyword',
},
Expand All @@ -92,9 +96,7 @@ const indices: IndexDefinition[] = [
},
},
name: '.elastic-connectors-sync-jobs-v1',
settings: {
hidden: true,
},
settings: defaultSettings,
},
];

Expand Down

0 comments on commit 68130f7

Please sign in to comment.