示例#1
0
 public LuceneSearchQuery(
     ISearchContext searchContext,
     string category, Analyzer analyzer, string[] fields, LuceneSearchOptions searchOptions, BooleanOperation occurance)
     : base(CreateQueryParser(searchContext, fields, analyzer), category, fields, searchOptions, occurance)
 {
     _searchContext = searchContext;
 }
 protected LuceneSearchQueryBase(CustomMultiFieldQueryParser queryParser,
                                 string category, string[] fields, LuceneSearchOptions searchOptions, BooleanOperation occurance)
 {
     Category      = category;
     AllFields     = fields ?? throw new ArgumentNullException(nameof(fields));
     SearchOptions = searchOptions;
     Queries.Push(new BooleanQuery());
     BooleanOperation = occurance;
     _queryParser     = queryParser;
 }
 protected LuceneSearchQueryBase(
     string category, Analyzer analyzer, string[] fields, LuceneSearchOptions searchOptions, BooleanOperation occurance)
 {
     Category      = category;
     AllFields     = fields ?? throw new ArgumentNullException(nameof(fields));
     SearchOptions = searchOptions;
     Queries.Push(new BooleanQuery());
     BooleanOperation = occurance;
     _queryParser     = new CustomMultiFieldQueryParser(LuceneVersion, fields, analyzer);
     _queryParser.AllowLeadingWildcard = searchOptions.AllowLeadingWildcard;
 }