Instantly share code, notes, and snippets.

Embed
What would you like to do?
ConfigurableUnifiedSearchFor
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();
}
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language)
{
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR);
}
public enum DefaultOperator
{
OR = 0,
AND = 1
}
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