API Reference
This section documents the complete Conjunction API.
ComparisonOperator
Represents the set of comparison operators a SearchQueryRule
Between
The operator represents a "set that contains just the specified" comparison.
Contains
The operator represents a "contains" comparison.
Equal
The operator represents a "equal" comparison.
GreaterThan
The operator represents a "greater than" comparison.
GreaterThanOrEqual
The operator represents a "greater than or equal" comparison.
LessThan
The operator represents a "less than" comparison.
LessThanOrEqual
The operator represents a "less than or equal" comparison.
NotBetween
The operator represents a "set that contains everything except the specified" comparison.
NotContains
The operator represents a "not contains" comparison.
NotEqual
The operator represents a "not equal" comparison.
ComparisonOperatorFactory
Represents the default factory for building types of ComparisonOperator.
IComparisonOperatorFactory
Provides functionality to build types of ComparisonOperator.
Create(rawComparisonOperator)
Creates a new ComparisonOperator based on the raw comparison operator value.
Name | Description |
---|---|
rawComparisonOperator | System.String The raw logical operator value. |
Returns
A comparison operator type.
ILogicalOperatorFactory
Provides functionality to build types of LogicalOperator.
Create(rawLogicalOperator)
Creates a new LogicalOperator based on the raw logical operator value.
Name | Description |
---|---|
rawLogicalOperator | System.String The raw logical operator value. |
Returns
A logical operator type.
ISearchQueryGroupingFactory
Provides functionality to build instances of type SearchQueryGrouping
Create(configuredLogicalOperator)
Creates a new SearchQueryGrouping
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
configuredLogicalOperator | System.String The raw logical operator value. |
Returns
A search query grouping instance.
LogicalOperatorFactory
Gets the ILogicalOperatorFactory that is associated with the given search query grouping factory.
ISearchQueryRuleFactory
Provides functionality to build instances of type SearchQueryRule
ComparisonOperatorFactory
Gets the IComparisonOperatorFactory that is associated with the given search query rule factory.
Create(associatedPropertyName, configuredComparisonOperator, dynamicValueProvidingParameter, defaultValue)
Creates a new SearchQueryRule
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
associatedPropertyName | System.String The associated property name of T. |
configuredComparisonOperator | System.String The configured comparison operator. |
dynamicValueProvidingParameter | System.String The dynamic value providing parameter (optional). |
defaultValue | System.String The default value (optional). |
Returns
A search query rule instance.
LogicalOperatorFactory
Represents the default factory for building types of LogicalOperator.
SearchQueryGroupingFactory
Represents the default factory for building instances of type SearchQueryGrouping
SearchQueryRuleFactory
Represents the default factory for building instances of type SearchQueryRule
IndexableEntity
Represents the base class of an indexable entity that is used when querying data from the search index.
ISearchQueryElement<T>
The base abstraction for all search query elements.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Accept(visitor)
Dispatches to the specific visit method for this search query element type. For example, SearchQueryRule
Name | Description |
---|---|
visitor | Processing.ISearchQueryElementVisitor<T> The visitor to visit this search query element with. |
LogicalOperator
Represents the set of logical operators a SearchQueryGrouping
And
The operator represents a "logical AND".
Or
The operator represents a "logical OR".
ISearchQueryElementVisitor<T>
Represents a visitor for search query elements.
Type Parameters
- T - The type of IndexableEntity implementation to use.
VisitSearchQueryGroupingBegin(searchQueryGrouping)
Visits the SearchQueryGrouping
Name | Description |
---|---|
searchQueryGrouping | SearchQueryGrouping<T> The search query grouping to visit. |
VisitSearchQueryGroupingEnd
Visits the SearchQueryGrouping
VisitSearchQueryRule(searchQueryRule)
Visits the SearchQueryRule
Name | Description |
---|---|
searchQueryRule | SearchQueryRule<T> The search query rule to visit. |
ISearchQueryPredicateBuilder<T>
Represents a specialized visitor that can build up a predicate of type Expression
Type Parameters
- T - The type of IndexableEntity implementation to use.
GetOutput
Returns the aggregated output produced by the predicate builder.
Returns
An aggregated predicate expression.
SearchQueryValueProvider
Gets the ISearchQueryValueProvider that is associated with the given predicate builder.
SearchQueryPredicateBuilder<T>
Represents the default ISearchQueryPredicateBuilder
Type Parameters
- T - The type of IndexableEntity implementation to use.
IIndexNameProvider
Provides functionality to deliver the index name that will be used when performing search queries.
IndexName
Gets the name representing this index to query.
SitecoreMasterOrWebIndexNameProvider
Represents the index name provider for Sitecore that, based on the Sitecore.Context, will resolve the either the Master or Web index.
ISearchQueryElementProvider
Provides functionality to retrieve a ISearchQueryElement
GetSearchQueryElementRoot
Returns the search query element root.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Returns
The search query element root
SearchQueryGroupingFactory
Gets the ISearchQueryGroupingFactory that is associated with the given provider.
SearchQueryRuleFactory
Gets the ISearchQueryRuleFactory that is associated with the given provider.
SitecoreSearchQueryElementProvider
Represents a Sitecore configured search query element provider, accepting a Sitecore.Data.Items.Item root, which gets transformed into a ISearchQueryElement
ISearchQueryValueProvider
Provides functionality for retrieving dynamically provided values used by SearchQueryRule
GetValueForSearchQueryRule(searchQueryRule)
Returns the value needed by the search query rule, which can either be a default or dynamically provided value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
searchQueryRule | SearchQueryRule<T> The specified search query rule. |
Returns
A typed value.
NameValuePairSearchQueryValueProvider
Represents a name/value pair based value provider, where the dynamic values required by the SearchQueryRule
SearchQueryValueProviderBase
Represents the base class of an search query value provider.
GetRawDefaultOrDynamicValueProvidedByParameter(searchQueryRule)
Retruns the raw value of either the default or dynamically provided value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
searchQueryRule | SearchQueryRule<T> The specifed search query rule |
Returns
A raw string value of either the default or dynamically provided value
GetValueForSearchQueryRule(searchQueryRule)
Returns the value needed by the search query value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
searchQueryRule | SearchQueryRule<T> The specifed search query rule |
Returns
A typed value
ISearchResultRepository<T>
Provides functionality to retrievin a SearchResult
Type Parameters
- T - The type of IndexableEntity implementation to use.
GetSearchResult(searchCriteria)
Performs a query using the provided searchCriteria to retrieve a SearchResult
Name | Description |
---|---|
searchCriteria | SearchCriteria |
Returns
A SearchResult
IndexNameProvider
Gets the IIndexNameProvider that is associated with the given search result repository.
SearchQueryElementProvider
Gets the ISearchQueryElementProvider that is associated with the given search result repository.
SearchQueryPredicateBuilder
Gets the ISearchQueryPredicateBuilder
SearchResultRepository<T>
Represents the main entry point for retrieving a SearchResult
Type Parameters
- T - The type of IndexableEntity implementation to use.
SearchCriteria
Represents the search criteria used by ISearchResultRepository
SearchPath
Gets the search path used to constraint where to look for documents in the search index.
SearchQueryGrouping<T>
Represents a search query grouping that defines a group of one or more search query elements, and their logical relationship to each other.
Type Parameters
- T - The type of IndexableEntity implementation to use.
LogicalOperator
Gets the LogicalOperator that is associated with the given search query grouping.
SearchQueryElements
Gets the search query elements children.
SearchQueryRule<T>
Represents a search query rule that defines how a given property of type T should be compared againts either a dynamically provided value or default value.
Remarks
This class could eventually also include whether to use fuzzy search or not, and if so, how much fuzzyness to use (number).
Type Parameters
- T - The type of IndexableEntity implementation to use.
ComparisonOperator
Gets the ComparisonOperator that is associated with the given search query rule.
DefaultValue
Gets the default value that is associated with the given search query rule.
DynamicValueProvidingParameter
Gets the dynamic value providing parameter that is associated with the given search query rule.
PropertySelector
Gets the property selector that is associated with the given search query rule.
SearchResult<T>
Represents the search result returned from querying a specific SearchCriteria using the SearchResultRepository
Type Parameters
- T - The type of IndexableEntity implementation to use.
Hits
Gets the hits found.
TotalSearchResults
Gets the total number of search results found.
SearchResultRepositoryBuilder<T>
Provides functionalities to build new ISearchResultRepository
Type Parameters
- T - The type of IndexableEntity implementation to use.
Create(searchQueryElementProvider, searchQueryValueProvider)
Creates a new ISearchResultRepository
Name | Description |
---|---|
searchQueryElementProvider | Providers.SearchQueryElement.ISearchQueryElementProvider |
searchQueryValueProvider | Providers.SearchQueryValue.ISearchQueryValueProvider |
WithIndexNameProvider
Configures the builder to use a given IIndexNameProvider type.
Type Parameters
- TIndexNameProvider - The type of IIndexNameProvider to use.
WithPredicateBuilder
Configures the builder to use a given ISearchQueryPredicateBuilder
Type Parameters
- TSearchQueryPredicateBuilder - The type of ISearchQueryPredicateBuilder
to use.
ExpressionConversionService
Provides functionalities for constructing expression trees, based on a given property selector and value.
ToBetween(propertySelector, lowerValue, upperValue, inclusion)
Converts the specified propertySelector to an 'between' expression using the given lowerValue and upperValue.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector |
lowerValue | System.Object The lower-bound value |
upperValue | System.Object The upper-bound value |
inclusion | Sitecore.ContentSearch.Linq.Inclusion The state of how the bounds are included |
ToContains(propertySelector, value)
Converts the specified propertySelector to an 'contains' expression using the given value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector |
value | System.String The value |
Returns
An expression on the form 'nameOfPropertySelector contains value'
ToEnumerableContains(propertySelector, value)
Converts the specified propertySelector of type System.Collections.IEnumerable to an 'contains' expression using the given value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector (must be of type System.Collections.IEnumerable) |
value | System.Object The value |
Returns
An expression on the form 'nameOfPropertySelector contains value'
ToEquals(propertySelector, value)
Converts the specified propertySelector to an 'equals' expression using the given value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector |
value | System.Object The value |
Returns
An expression on the form 'nameOfPropertySelector equals value'
ToGreaterThanOrEqual(propertySelector, value)
Converts the specified propertySelector to an 'greater-than-or-equals' expression using the given value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector |
value | System.Object The value |
Returns
An expression on the form 'nameOfPropertySelector greater-than-or-equals value'
ToLessThanOrEqual(propertySelector, value)
Converts the specified propertySelector to an 'less-than-or-equals' expression using the given value.
Type Parameters
- T - The type of IndexableEntity implementation to use.
Name | Description |
---|---|
propertySelector | System.Linq.Expressions.Expression{System.Func{T,System.Object}} The property selector |
value | System.Object The value |
Returns
An expression on the form 'nameOfPropertySelector less-than-or-equals value'
SearchQueryValueConversionService
Provides functionalities for converting raw System.String values into typed values.
ToTypedValue(valueType, value)
Converts the value to the specified valueType.
Name | Description |
---|---|
valueType | System.Type The value type that the specified value needs to be converted into. |
value | System.String The value that needs to be converted. |
TryConvertToRangeValueParts(value, rangeValueParts)
Tries to convert the specified value into range value parts.
Remarks
The output parameter rangeValueParts is intended to be used within the RangeValue type.
Name | Description |
---|---|
value | System.String The value that needs to be converted. |
rangeValueParts | System.Tuple{System.String,System.String} The range value parts ressembling the range values, if converted. |