File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ dotenv.config();
44
55import { CveResult } from '../result/CveResult.js' ;
66import { SearchResultData } from "./SearchResultData.js" ;
7+ import { SearchProviderSpec } from '../adapters/search/SearchAdapter.js' ;
8+ import { SearchReader } from '../adapters/search/SearchReader.js' ;
79import { BasicSearchManager , SearchOptions } from "./BasicSearchManager.js"
810
911export class SearchAPIOptions extends SearchOptions {
@@ -25,6 +27,21 @@ export class rangeObject {
2527}
2628
2729export class AdvancedSearchManager extends BasicSearchManager {
30+
31+ /** constructor that sets up provider information
32+ * @param searchProviderSpec optional specifications providing provider information
33+ * default is to read it from environment variables
34+ */
35+ constructor ( searchProviderSpec : SearchProviderSpec = undefined ) {
36+ super ( ) ;
37+ if ( ! searchProviderSpec ) {
38+ searchProviderSpec = SearchProviderSpec . getDefaultSearchProviderSpec ( )
39+ }
40+ this . _searchReader = new SearchReader (
41+ searchProviderSpec . providerEndpoint ,
42+ searchProviderSpec . index ) ;
43+ }
44+
2845 /** search for text at search provider
2946 * @param searchText the text string to search for
3047 * @param options options to specify how to search, with well-defined defaults
You can’t perform that action at this time.
0 commit comments