Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/Nest/DSL/UpdateSettingsDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public interface IUpdateSettingsRequest : IIndexOptionalPath<UpdateSettingsReque
[JsonProperty("index.cache.filter.expire")]
string CacheFilterExpire { get; set; }

[JsonProperty("index.cache.query.enable")]
bool? CacheQueryEnable { get; set; }

[JsonProperty("index.gateway.snapshot_interval")]
string GatewaySnapshotInterval { get; set; }

Expand Down Expand Up @@ -154,8 +157,10 @@ public partial class UpdateSettingsRequest : IndexOptionalPathBase<UpdateSetting
public string CacheFilterMaxSize { get; set; }

public string CacheFilterExpire { get; set; }

public bool? CacheQueryEnable { get; set; }

public string GatewaySnapshotInterval { get; set; }
public string GatewaySnapshotInterval { get; set; }

public IDictionary<string, object> RoutingAllocationInclude { get; set; }

Expand Down Expand Up @@ -236,6 +241,8 @@ public partial class UpdateSettingsDescriptor

string IUpdateSettingsRequest.CacheFilterExpire { get; set; }

bool? IUpdateSettingsRequest.CacheQueryEnable { get; set; }

string IUpdateSettingsRequest.GatewaySnapshotInterval { get; set; }

IDictionary<string, object> IUpdateSettingsRequest.RoutingAllocationInclude { get; set; }
Expand Down Expand Up @@ -434,6 +441,15 @@ public UpdateSettingsDescriptor CacheFilterExpire(string cacheFilterExpire)
return this;
}

/// <summary>
/// Enable or disable the query cache.
/// </summary>
public UpdateSettingsDescriptor CacheQueryEnable(bool cacheQueryEnable)
{
this.Self.CacheQueryEnable = cacheQueryEnable;
return this;
}

/// <summary>
/// The gateway snapshot interval (only applies to shared gateways). Defaults to 10s.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void AllUpdateSettings()
.BlocksWrite()
.CacheFilterExpire("1m")
.CacheFilterMaxSize("1Gb")
.CacheQueryEnable(true)
.CodeBloomLoad()
.Codec("default")
.CompoundFormat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public UpdateSettingsRequestTests()
TranslogDisableFlush = true,
CacheFilterMaxSize = "-1",
CacheFilterExpire = "-1",
CacheQueryEnable = true,
GatewaySnapshotInterval = "5s",
RoutingAllocationInclude = new Dictionary<string, object> { { "tag", "value1,value2" } },
RoutingAllocationExclude = new Dictionary<string, object> { { "tag", "value3" } },
Expand Down