/// <summary> /// Configure core services /// </summary> /// <param name="serviceProvider">DI engine to be configured</param> /// <param name="options">Options to control SolrExpress behavior</param> internal static void Configure <TDocument>(ISolrExpressServiceProvider <TDocument> serviceProvider, SolrExpressOptions options) where TDocument : Document { serviceProvider .AddSingleton(options) .AddTransient(serviceProvider); var solrConnection = new SolrConnection(options); var expressionBuilder = new ExpressionBuilder <TDocument>(options, solrConnection); if (!options.LazyInfraValidation) { expressionBuilder.LoadDocument(); } serviceProvider .AddTransient(expressionBuilder) .AddTransient <DocumentSearch <TDocument> >() .AddTransient <DocumentUpdate <TDocument> >() .AddTransient <SearchResultBuilder <TDocument> >() .AddTransient <SearchQuery <TDocument> >() .AddTransient <ISolrConnection>(solrConnection) .AddTransient <IDocumentResult <TDocument>, DocumentResult <TDocument> >() .AddTransient <IChangeDynamicFieldBehaviour <TDocument>, ChangeDynamicFieldBehaviour <TDocument> >(); }
/// <summary> /// Default constructor of class /// </summary> public DocumentUpdate( ISolrConnection solrConnection, ISolrExpressServiceProvider <TDocument> serviceProvider) { Checker.IsNull(solrConnection); Checker.IsNull(serviceProvider); this._solrConnection = solrConnection; this.ServiceProvider = serviceProvider; }
public DocumentSearch( SolrExpressOptions solrExpressOptions, ISolrExpressServiceProvider <TDocument> serviceProvider, ISearchItemCollection <TDocument> searchItemCollection) { Checker.IsNull(solrExpressOptions); Checker.IsNull(serviceProvider); Checker.IsNull(searchItemCollection); this._solrExpressOptions = solrExpressOptions; this._searchItemCollection = searchItemCollection; this.ServiceProvider = serviceProvider; }
public DocumentCollection(ISolrExpressServiceProvider <TDocument> serviceProvider) { Checker.IsNull(serviceProvider); this._serviceProvider = serviceProvider; }
public FacetRangeParameter(ExpressionBuilder <TDocument> expressionBuilder, ISolrExpressServiceProvider <TDocument> serviceProvider) { this.ExpressionBuilder = expressionBuilder; this.ServiceProvider = serviceProvider; }
public SolrExpressBuilder(ISolrExpressServiceProvider <TDocument> serviceProvider) { this.ServiceProvider = serviceProvider; }
/// <summary> /// Create a filter parameter /// </summary> /// <param name="serviceProvider">Dependency injection engine</param> /// <returns>Filter parameter</returns> public static IFilterParameter <TDocument> Filter <TDocument>(this ISolrExpressServiceProvider <TDocument> serviceProvider) where TDocument : Document { return(serviceProvider.GetService <IFilterParameter <TDocument> >()); }
/// <summary> /// Create a sort parameter configured to do a random sort /// </summary> /// <param name="serviceProvider">Dependency injection engine</param> /// <returns>Sort parameter configured to do a random sort</returns> public static ISortRandomlyParameter <TDocument> SortRandomly <TDocument>(this ISolrExpressServiceProvider <TDocument> serviceProvider) where TDocument : Document { return(serviceProvider.GetService <ISortRandomlyParameter <TDocument> >()); }
/// <summary> /// Create a query field parameter /// </summary> /// <param name="serviceProvider">Dependency injection engine</param> /// <returns>Query field parameter</returns> public static IQueryFieldParameter <TDocument> QueryField <TDocument>(this ISolrExpressServiceProvider <TDocument> serviceProvider) where TDocument : Document { return(serviceProvider.GetService <IQueryFieldParameter <TDocument> >()); }
/// <summary> /// Create a minimum should match /// </summary> /// <param name="serviceProvider">Dependency injection engine</param> /// <returns>Minimum should match</returns> public static IMinimumShouldMatchParameter <TDocument> MinimumShouldMatch <TDocument>(this ISolrExpressServiceProvider <TDocument> serviceProvider) where TDocument : Document { return(serviceProvider.GetService <IMinimumShouldMatchParameter <TDocument> >()); }
public FacetQueryParameter(ISolrExpressServiceProvider <TDocument> serviceProvider) { this.ServiceProvider = serviceProvider; }