Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add index.queries.cache.enabled setting to IndexSettings
- Loading branch information
Showing
9 changed files
with
111 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/Nest/IndexModules/IndexSettings/Queries/IQueriesCacheSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Nest | ||
{ | ||
public interface IQueriesCacheSettings | ||
{ | ||
/// <summary> | ||
/// Whether the query cache is enabled. <c>True</c> by default. | ||
/// </summary> | ||
bool? Enabled { get; set; } | ||
} | ||
|
||
public class QueriesCacheSettings : IQueriesCacheSettings | ||
{ | ||
public bool? Enabled { get; set; } | ||
} | ||
|
||
public class QueriesCacheSettingsDescriptor : DescriptorBase<QueriesCacheSettingsDescriptor, IQueriesCacheSettings>, IQueriesCacheSettings | ||
{ | ||
bool? IQueriesCacheSettings.Enabled { get; set; } | ||
|
||
/// <inheritdoc/> | ||
public QueriesCacheSettingsDescriptor Enabled(bool enabled = true) => | ||
Assign(a => a.Enabled = enabled); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Nest/IndexModules/IndexSettings/Queries/IQueriesSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
|
||
namespace Nest | ||
{ | ||
public interface IQueriesSettings | ||
{ | ||
IQueriesCacheSettings Cache { get; set; } | ||
} | ||
|
||
public class QueriesSettings : IQueriesSettings | ||
{ | ||
public IQueriesCacheSettings Cache { get; set; } | ||
} | ||
|
||
public class QueriesSettingsDescriptor : DescriptorBase<QueriesSettingsDescriptor, IQueriesSettings>, IQueriesSettings | ||
{ | ||
IQueriesCacheSettings IQueriesSettings.Cache { get; set; } | ||
|
||
/// <inheritdoc/> | ||
public QueriesSettingsDescriptor Cache(Func<QueriesCacheSettingsDescriptor, IQueriesCacheSettings> selector) => | ||
Assign(a => a.Cache = selector.Invoke(new QueriesCacheSettingsDescriptor())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters