예제 #1
0
 public DefaultReversedSearchEngine(
     IIndexNameProvider indexNameProvider,
     IEsSearcher <TestModel> searcher)
     : base(indexNameProvider, searcher, new SimpleSearchStrategy())
 {
     DefaultSort = new RevertSort();
 }
예제 #2
0
 public SingleDigitTermDefaultFilteredSearchEngine(
     IIndexNameProvider indexNameProvider,
     IEsSearcher <TestModel> searcher)
     : base(indexNameProvider, searcher, new SimpleSearchStrategy())
 {
     DefaultFilter = new SingleDigitTermFilter();
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="SearchEngine"/>
 /// </summary>
 public EsSearchEngine(IIndexNameProvider indexNameProvider, IEsSearcher <TDoc> searcher,
                       IEsSearchEngineStrategy <TDoc> defaultStrategy)
 {
     _indexName       = indexNameProvider.Provide <TDoc>();
     _searcher        = searcher ?? throw new ArgumentNullException(nameof(searcher));
     _defaultStrategy = defaultStrategy;
 }
 public EsSearcherBehavior(ClientFixture clFx, ITestOutputHelper output)
 {
     _clFx     = clFx;
     _output   = output;
     _searcher = new EsSearcher <TestEntity>(new SingleEsClientProvider(_clFx.EsClient), null, (ElasticsearchOptions)null);
     _indexer  = new EsIndexer <TestEntity>(new SingleEsClientProvider(_clFx.EsClient), null, (ElasticsearchOptions)null);
 }
예제 #5
0
 public SimpleSearchEngine(
     IIndexNameProvider indexNameProvider,
     IEsSearcher <TestModel> searcher)
     : base(indexNameProvider, searcher, new SimpleSearchStrategy())
 {
     RegisterNamedFilter("single-digit", new SingleDigitTermFilter());
     RegisterNamedSort("revert", new RevertSort());
     RegisterNamedSort("norm", new NormSort());
 }
예제 #6
0
 public SearchEngineWithStrategyPredefinedFilter(
     IIndexNameProvider indexNameProvider,
     IEsSearcher <TestModel> searcher)
     : base(indexNameProvider, searcher, new WithPredefinedFilterSearchStrategy())
 {
 }