Class SolrSearchProvider
Namespace: Mediachase.Search.Providers.Solr
Assembly: Mediachase.Search.SolrSearchProvider.dll
Version: 12.17.2Syntax
public class SolrSearchProvider : SearchProvider
Constructors
SolrSearchProvider()
Declaration
public SolrSearchProvider()
Properties
AutoCommit
Gets or sets a value indicating whether [auto commit].
Declaration
public bool AutoCommit { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AutoCommitCount
Gets or sets the auto commit count.
Declaration
public int AutoCommitCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The auto commit count. |
QueryBuilderType
Gets the type of the query builder.
Declaration
public override string QueryBuilderType { get; }
Property Value
Type | Description |
---|---|
System.String | The type of the query builder. |
Overrides
Examples
// the following type will build query for the SOLR server "Mediachase.Search.Providers.Solr.SolrSearchQueryBuilder, Mediachase.Search.SolrSearchProvider"
ShareCores
Gets or sets a value indicating whether cores are shared between different applications. If set to false, individual cores will be created for each application with a name "ApplicationName.CoreName".
Declaration
public bool ShareCores { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SolrServerUrl
Gets or sets the solr server URL without Core secified.
Declaration
public string SolrServerUrl { get; }
Property Value
Type | Description |
---|---|
System.String | The solr server URL. |
Examples
http://localhost:8983/solr
Methods
Close(String, String)
Closes the specified provider.
Declaration
public override void Close(string applicationName, string scope)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
System.String | scope | The scope. |
Overrides
Commit(String)
Commits changes made to this instance.
Declaration
public override void Commit(string applicationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
Overrides
GetFacetParameters(ISearchCriteria)
Gets the facet parameters.
Declaration
protected virtual FacetParameters GetFacetParameters(ISearchCriteria criteria)
Parameters
Type | Name | Description |
---|---|---|
ISearchCriteria | criteria | The criteria. |
Returns
Type | Description |
---|---|
SolrNet.Commands.Parameters.FacetParameters |
Index(String, String, ISearchDocument)
Adds the document to the index. Depending on the provider, the document will be commited only after commit is called.
Declaration
public override void Index(string applicationName, string scope, ISearchDocument document)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
System.String | scope | The scope. |
ISearchDocument | document | The document. |
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 the document.
Declaration
public override int Remove(string applicationName, string scope, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
System.String | scope | The scope. |
System.String | key | The key. |
System.String | value | The value. |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
RemoveAll(String, String)
Removes all in the specified scope.
Declaration
public override void RemoveAll(string applicationName, string scope)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
System.String | scope | The scope. |
Overrides
Search(String, ISearchCriteria)
Searches the datasource using the specified criteria. Criteria is parsed by the query builder specified by SolrSearchProvider.QueryBuilderType.
Declaration
public override ISearchResults Search(string applicationName, ISearchCriteria criteria)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName | Name of the application. |
ISearchCriteria | criteria | The criteria. |
Returns
Type | Description |
---|---|
ISearchResults |