November Happy Hour will be moved to Thursday December 5th.

Class SolrSearchProvider

Inheritance
System.Object
SolrSearchProvider
Namespace: Mediachase.Search.Providers.Solr35
Assembly: Mediachase.Search.Solr35SearchProvider.dll
Version: 12.17.2
Syntax
public class SolrSearchProvider : SearchProvider, ISearchProviderConfigGenerator

Constructors

SolrSearchProvider()

Declaration
public SolrSearchProvider()

Fields

DateTimeFormatString

Declaration
public const string DateTimeFormatString = "yyyy-MM-dd'T'HH:mm:ss'Z'"
Field Value
Type Description
System.String

Properties

QueryBuilderType

Declaration
public override string QueryBuilderType { get; }
Property Value
Type Description
System.String
Overrides

Methods

Close(String, String)

Commits the specified core and removes internal structures related to it.

Declaration
public override void Close(string applicationName, string scope)
Parameters
Type Name Description
System.String applicationName
System.String scope
Overrides

Commit(String)

Sends and pending update and/or delete commands to the server. This does not necessarily perform a commit.

Declaration
public override void Commit(string applicationName)
Parameters
Type Name Description
System.String applicationName

The application name to commit.

Overrides
Remarks

This send all pending operations to the Solr instance for a specified application name, even if they are in separate scopes. In shared core mode, all pending updates will be sent.

An actual commit may not be executed on the server. If any additions/updates are included in the pending command list, a commitWithin directive will be sent. If only deletes are included in the pending command list, a synchronous commit will be issued.

GenerateCatalogConfiguration(MetaDataContext)

Generates an XML stub to paste into schema.xml describing Solr schema configuration for metafields.

Declaration
public string GenerateCatalogConfiguration(MetaDataContext catalogContext)
Parameters
Type Name Description
MetaDataContext catalogContext

The metadata context to load catalog entry metaclass configuration from.

Returns
Type Description
System.String

A string suitable for pasting into the supplied schema.xml.

GetLocalizedDescription(Descriptions, String)

Gets the best matching description for a locale.

Declaration
public static string GetLocalizedDescription(Descriptions descriptions, string forLocale)
Parameters
Type Name Description
Descriptions descriptions

The object containing localized descriptions.

System.String forLocale

The desired locale.

Returns
Type Description
System.String

The description best matching the requested locale, or null if no matching description is found.

Remarks

From highest priority to lowest, the attempted matches are:

All comparison are performed with StringComparison.OrdinalIgnoreCase. If none of the above matches are found, null is returned.

Index(String, String, ISearchDocument)

Adds or updates a document in the search index. The operation may not be transmitted to the Solr server immediately.

Declaration
public override void Index(string applicationName, string scope, ISearchDocument document)
Parameters
Type Name Description
System.String applicationName

The application name.

System.String scope

The scope of the instance.

ISearchDocument document

An object describing the document to be indexed.

Overrides

Initialize(String, NameValueCollection)

Initializes the provider.

Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
Type Name Description
System.String name

The friendly name of the provider.

System.Collections.Specialized.NameValueCollection config

A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.

Exceptions
Type Condition
System.ArgumentNullException

The name of the provider is null.

System.ArgumentException

The name of the provider has a length of zero.

System.InvalidOperationException

An attempt is made to call System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection) on a provider after the provider has already been initialized.

Remove(String, String, String, String)

Removes documents matching the key/value pair from the search index. The operation may not be transmitted to the Solr server immediately.

Declaration
public override int Remove(string applicationName, string scope, string key, string value)
Parameters
Type Name Description
System.String applicationName

The application name. May be null or empty if the provider is in shared core mode.

System.String scope

The scope of the instance.

System.String key

The name of the field to query for deletes on.

System.String value

The value of the key field to delete.

Returns
Type Description
System.Int32

Zero (meaningless).

Overrides

RemoveAll(String, String)

Removes all documents from the Solr instance, or all documents for the application in shared core mode.

Declaration
public override void RemoveAll(string applicationName, string scope)
Parameters
Type Name Description
System.String applicationName

The application name. May be null or empty if the provider is in shared core mode.

System.String scope

The scope of the instance.

Overrides

Search(String, ISearchCriteria)

Queries the Solr engine with the specified search criteria.

Declaration
public override ISearchResults Search(string applicationName, ISearchCriteria criteria)
Parameters
Type Name Description
System.String applicationName

The application name. May be null or empty if the provider is in shared core mode.

ISearchCriteria criteria

The search criteria.

Returns
Type Description
ISearchResults

An object representing the results of the search.

Overrides

Implements