Hi again,
When i use
ISearchResult Search(JObject query, string contentType = "")
method index configuration Field Strategy is :
DotJEM.Json.Index.Configuration.FieldStrategies.FieldStrategy
but when i use
ISearchResult Search(Query query) method
the Field Strategy is :
DotJEM.Json.Index.Configuration.FieldStrategies.TermFieldStrategy
can you explain why this reason?
Because it occur problem for me.
For example :
var query = JObject.Parse("{\"Name\":\"Lill\"}");
List <dynamic> result = index.Searcher.Search(query).Select(hit => hit.Json).ToList();
it returns result. but i have not a person that named "Lill". it is name is Lilly. this method adds wildcardquery due to the FieldStrategy
public virtual Query BuildQuery(string field, string value)
{
value = value.ToLowerInvariant();
string[] words = value.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
if (!words.Any())
return null;
BooleanQuery query = new BooleanQuery();
foreach (string word in words)
{
//Note: As for the WildcardQuery, we only add the wildcard to the end for performance reasons.
query.Add(new FuzzyQuery(new Term(field, word)), Occur.SHOULD);
query.Add(new WildcardQuery(new Term(field, word + "*")), Occur.SHOULD);
}
return query;
}
but when i use
Query query = new TermQuery(new Term("Name", @"Lill"));
List <dynamic> result = index.Searcher.Search(query).Select(hit => hit.Json).ToList();
it returns 0 result and it is correct.
i dont want to change your source code . So can you give me a trick for this problem?
sorry about my english.
Thanks.
Hi again,
When i use
ISearchResult Search(JObject query, string contentType = "")method index configuration Field Strategy is :
DotJEM.Json.Index.Configuration.FieldStrategies.FieldStrategybut when i use
ISearchResult Search(Query query)methodthe Field Strategy is :
DotJEM.Json.Index.Configuration.FieldStrategies.TermFieldStrategycan you explain why this reason?
Because it occur problem for me.
For example :
it returns result. but i have not a person that named "Lill". it is name is Lilly. this method adds wildcardquery due to the FieldStrategy
but when i use
it returns 0 result and it is correct.
i dont want to change your source code . So can you give me a trick for this problem?
sorry about my english.
Thanks.