diff --git a/src/NRedisStack/Search/ISearchCommands.cs b/src/NRedisStack/Search/ISearchCommands.cs
index d931a040..33e746ff 100644
--- a/src/NRedisStack/Search/ISearchCommands.cs
+++ b/src/NRedisStack/Search/ISearchCommands.cs
@@ -146,19 +146,21 @@ public interface ISearchCommands
/// Return the execution plan for a complex query
///
/// The index name
- /// The query to explain
+ /// The query to explain
+ /// Dialect version under which to execute the query
/// String that representing the execution plan
///
- string Explain(string indexName, Query q);
+ string Explain(string indexName, string query, int? dialect = null);
///
/// Return the execution plan for a complex query
///
/// The index name
- /// The query to explain
+ /// The query to explain
+ /// Dialect version under which to execute the query
/// An array reply with a string representing the execution plan
///
- RedisResult[] ExplainCli(string indexName, Query q);
+ RedisResult[] ExplainCli(string indexName, string query, int? dialect = null);
///
/// Return information and statistics on the index.
diff --git a/src/NRedisStack/Search/ISearchCommandsAsync.cs b/src/NRedisStack/Search/ISearchCommandsAsync.cs
index 7948459b..e335c10e 100644
--- a/src/NRedisStack/Search/ISearchCommandsAsync.cs
+++ b/src/NRedisStack/Search/ISearchCommandsAsync.cs
@@ -145,19 +145,21 @@ public interface ISearchCommandsAsync
/// Return the execution plan for a complex query
///
/// The index name
- /// The query to explain
+ /// The query to explain
+ /// Dialect version under which to execute the query
/// String that representing the execution plan
///
- Task ExplainAsync(string indexName, Query q);
+ Task ExplainAsync(string indexName, string query, int? dialect = null);
///
/// Return the execution plan for a complex query
///
/// The index name
- /// The query to explain
+ /// The query to explain
+ /// Dialect version under which to execute the query
/// An array reply with a string representing the execution plan
///
- Task ExplainCliAsync(string indexName, Query q);
+ Task ExplainCliAsync(string indexName, string query, int? dialect = null);
///
/// Return information and statistics on the index.
diff --git a/src/NRedisStack/Search/Query.cs b/src/NRedisStack/Search/Query.cs
index 0fa42f6c..ce97017f 100644
--- a/src/NRedisStack/Search/Query.cs
+++ b/src/NRedisStack/Search/Query.cs
@@ -191,12 +191,12 @@ public HighlightTags(string open, string close)
public string Scorer { get; set; }
// public bool ExplainScore { get; set; } // TODO: Check if this is needed because Jedis doesn't have it
- private Dictionary _params = new Dictionary();
+ private Dictionary _params = new Dictionary();
public int? dialect { get; private set;} = null;
private int _slop = -1;
private long _timeout = -1;
private bool _inOrder = false;
- private string _expander = null;
+ private string? _expander = null;
public Query() : this("*") { }
diff --git a/src/NRedisStack/Search/SearchCommandBuilder.cs b/src/NRedisStack/Search/SearchCommandBuilder.cs
index 7899c24e..35d82136 100644
--- a/src/NRedisStack/Search/SearchCommandBuilder.cs
+++ b/src/NRedisStack/Search/SearchCommandBuilder.cs
@@ -126,17 +126,25 @@ public static SerializedCommand DropIndex(string indexName, bool dd = false)
: new SerializedCommand(FT.DROPINDEX, indexName));
}
- public static SerializedCommand Explain(string indexName, Query q)
+ public static SerializedCommand Explain(string indexName, string query, int? dialect)
{
- var args = new List