diff --git a/src/Nest/DSL/UpdateSettingsDescriptor.cs b/src/Nest/DSL/UpdateSettingsDescriptor.cs index 0f392688997..22f41c69f17 100644 --- a/src/Nest/DSL/UpdateSettingsDescriptor.cs +++ b/src/Nest/DSL/UpdateSettingsDescriptor.cs @@ -59,6 +59,9 @@ public interface IUpdateSettingsRequest : IIndexOptionalPath RoutingAllocationInclude { get; set; } @@ -236,6 +241,8 @@ public partial class UpdateSettingsDescriptor string IUpdateSettingsRequest.CacheFilterExpire { get; set; } + bool? IUpdateSettingsRequest.CacheQueryEnable { get; set; } + string IUpdateSettingsRequest.GatewaySnapshotInterval { get; set; } IDictionary IUpdateSettingsRequest.RoutingAllocationInclude { get; set; } @@ -434,6 +441,15 @@ public UpdateSettingsDescriptor CacheFilterExpire(string cacheFilterExpire) return this; } + /// + /// Enable or disable the query cache. + /// + public UpdateSettingsDescriptor CacheQueryEnable(bool cacheQueryEnable) + { + this.Self.CacheQueryEnable = cacheQueryEnable; + return this; + } + /// /// The gateway snapshot interval (only applies to shared gateways). Defaults to 10s. /// diff --git a/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/AllUpdateSettings.json b/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/AllUpdateSettings.json index d36e69b35b4..00042a46d3c 100644 --- a/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/AllUpdateSettings.json +++ b/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/AllUpdateSettings.json @@ -16,6 +16,7 @@ "index.translog.disable_flush": true, "index.cache.filter.max_size": "1Gb", "index.cache.filter.expire": "1m", + "index.cache.query.enable": true, "index.gateway.snapshot_interval": "1h", "index.routing.allocation.include": { "_ip": "10.0.0.1" diff --git a/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/UpdateSettingsTests.cs b/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/UpdateSettingsTests.cs index d4823019e87..cbf3eca4c6d 100644 --- a/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/UpdateSettingsTests.cs +++ b/src/Tests/Nest.Tests.Unit/Core/UpdateSettings/UpdateSettingsTests.cs @@ -20,6 +20,7 @@ public void AllUpdateSettings() .BlocksWrite() .CacheFilterExpire("1m") .CacheFilterMaxSize("1Gb") + .CacheQueryEnable(true) .CodeBloomLoad() .Codec("default") .CompoundFormat() diff --git a/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsBody.json b/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsBody.json index 7a6280773d2..d74836283f2 100644 --- a/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsBody.json +++ b/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsBody.json @@ -16,6 +16,7 @@ "index.translog.disable_flush": true, "index.cache.filter.max_size": "-1", "index.cache.filter.expire": "-1", + "index.cache.query.enable": true, "index.gateway.snapshot_interval": "5s", "index.routing.allocation.include": { "tag": "value1,value2" diff --git a/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsRequestTests.cs b/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsRequestTests.cs index 0903c535f42..5877f4aa4e9 100644 --- a/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsRequestTests.cs +++ b/src/Tests/Nest.Tests.Unit/ObjectInitializer/UpdateSettings/UpdateSettingsRequestTests.cs @@ -35,6 +35,7 @@ public UpdateSettingsRequestTests() TranslogDisableFlush = true, CacheFilterMaxSize = "-1", CacheFilterExpire = "-1", + CacheQueryEnable = true, GatewaySnapshotInterval = "5s", RoutingAllocationInclude = new Dictionary { { "tag", "value1,value2" } }, RoutingAllocationExclude = new Dictionary { { "tag", "value3" } },