I want to write the same query using Nest SDK, something like the following
private Nest.WildcardQuery CreateQuery()
{
Nest.WildcardQuery query = new Nest.WildcardQuery();
query.Field = "Author";
query.Value = "*joe*";
query.Rewrite = Nest.RewriteMultiTerm.TopTermsN;
//Now how to specify a value for N ?
return query;
}
How can I specify a value for N ? (when using Nest.RewriteMultiTerm.TopTermsN)
Elastic version 5.2.1 Kibana version 5.2.1 Nest version 5.2.0
In the meantime, you can workaround this by using the low client exposed on NEST
var response = client.LowLevel.Search<SearchResponse<object>>("my-index",
@"{
""query"": {
""wildcard"": {
""Author"": {
""value"": ""*joe*"",
""rewrite"": ""top_terms_15""
}
}
}
}");
// a search response that you would be returned from a NEST search query
var nestResponse = response.Body;
In using the low level client on NEST, you can still return a SearchResponse<T> as you would have expected from a search query with NEST. You can specify the query with an anonymous type if you prefer but I have used a string here.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.