ConfigurableUnifiedSearchFor
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 IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language, DefaultOperator defaultOperator) | |
{ | |
if (defaultOperator == DefaultOperator.AND) | |
{ | |
return client.UnifiedSearch(language).For(query).WithAndAsDefaultOperator().UsingUnifiedWeights(); | |
} | |
return client.UnifiedSearch(language).For(query).UsingUnifiedWeights(); | |
} |
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 IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language) | |
{ | |
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR); | |
} |
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 enum DefaultOperator | |
{ | |
OR = 0, | |
AND = 1 | |
} |
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 enum DefaultOperator | |
{ | |
OR = 0, | |
AND = 1 | |
} | |
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language) | |
{ | |
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR); | |
} | |
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language, DefaultOperator defaultOperator) | |
{ | |
if (defaultOperator == DefaultOperator.AND) | |
{ | |
return client.UnifiedSearch(language).For(query).WithAndAsDefaultOperator().UsingUnifiedWeights(); | |
} | |
return client.UnifiedSearch(language).For(query).UsingUnifiedWeights(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment