Created
April 4, 2017 10:23
-
-
Save lindstromhenrik/2fae44c340a8c06a61b501025303ba56 to your computer and use it in GitHub Desktop.
InAnalyzedField-extension
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
public static class QueryStringSearchExtensions { | |
public static IQueriedSearch<TSource, QueryStringQuery> InAnalyzedField<TSource, TExistingQuery>( | |
this IQueriedSearch<TSource, TExistingQuery> search, | |
Expression<Func<TSource, string>> fieldSelector, | |
double? relativeImportance = null) | |
where TExistingQuery : QueryStringQuery | |
{ | |
fieldSelector.ValidateNotNullArgument("fieldSelector"); | |
return search.InField(search.Client.Conventions.FieldNameConvention.GetFieldNameForAnalyzed((Expression)fieldSelector), relativeImportance); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment