public static QueryBase GetDefaultQuery(this TermNode node, IQueryVisitorContext context)
        {
            if (!(context is IElasticQueryVisitorContext elasticContext))
            {
                throw new ArgumentException("Context must be of type IElasticQueryVisitorContext", nameof(context));
            }

            QueryBase query;
            string    field         = node.Field;
            var       defaultFields = node.GetDefaultFields(elasticContext.DefaultFields);

            if (field == null && defaultFields != null && defaultFields.Length == 1)
            {
                field = defaultFields[0];
            }

            if (elasticContext.MappingResolver.IsPropertyAnalyzed(field))
            {
                var fields = !String.IsNullOrEmpty(field) ? new[] { field } : defaultFields;

                if (!node.IsQuotedTerm && node.UnescapedTerm.EndsWith("*"))
                {
                    query = new QueryStringQuery {
                        Fields = fields,
                        AllowLeadingWildcard = false,
                        AnalyzeWildcard      = true,
                        Query = node.UnescapedTerm
                    };
                }
                else
                {
                    if (fields != null && fields.Length == 1)
                    {
                        if (node.IsQuotedTerm)
                        {
                            query = new MatchPhraseQuery {
                                Field = fields[0],
                                Query = node.UnescapedTerm
                            };
                        }
                        else
                        {
                            query = new MatchQuery {
                                Field = fields[0],
                                Query = node.UnescapedTerm
                            };
                        }
                    }
                    else
                    {
                        query = new MultiMatchQuery {
                            Fields = fields,
                            Query  = node.UnescapedTerm
                        };
                        if (node.IsQuotedTerm)
                        {
                            ((MultiMatchQuery)query).Type = TextQueryType.Phrase;
                        }
                    }
                }
            }
            else
            {
                if (!node.IsQuotedTerm && node.UnescapedTerm.EndsWith("*"))
                {
                    query = new PrefixQuery {
                        Field = field,
                        Value = node.UnescapedTerm.TrimEnd('*')
                    };
                }
                else
                {
                    query = new TermQuery {
                        Field = field,
                        Value = node.UnescapedTerm
                    };
                }
            }

            return(query);
        }