public override List<SkinnyItem> GetItems(string databaseName, string indexName, string language, string templateFilter, bool searchBaseTemplates, string locationFilter, string fullTextQuery) { var searchParam = new NumericRangeSearchParam { Database = databaseName, Ranges = NumericRanges, LocationIds = locationFilter, TemplateIds = templateFilter, SearchBaseTemplates = searchBaseTemplates, FullTextQuery = fullTextQuery, InnerCondition = GetCondition(InnerNumericRangeConditionList), Language = language }; using (var runner = new QueryRunner(indexName)) { return runner.GetItems(searchParam); } }
public override List<SkinnyItem> GetItems(string databaseName, string indexName, string language, string templateFilter, string locationFilter, string fullTextQuery) { var baseCondition = GetCondition(BaseOccuranceList); var outerNumParamParamCondition = GetCondition(NumericRangeOccuranceList); var outerDateParamCondition = GetCondition(DateRangeOccuranceList); var innerNumParamParamCondition = GetCondition(InnerNumericRangeOccuranceList); var innerDateParamCondition = GetCondition(InnerDateRangeOccuranceList); var baseSearchParam = new SearchParam { Database = databaseName, LocationIds = locationFilter, TemplateIds = templateFilter, FullTextQuery = fullTextQuery, Language = language, Condition = baseCondition }; var numSearchParam = new NumericRangeSearchParam { Ranges = NumericRanges, InnerCondition = innerNumParamParamCondition, Condition = outerNumParamParamCondition }; var dateSearchParam = new DateRangeSearchParam { Ranges = DateRanges, InnerCondition = innerDateParamCondition, Condition = outerDateParamCondition }; using (var runner = new QueryRunner(indexName)) { return runner.GetItems(new[] { baseSearchParam, numSearchParam, dateSearchParam }); } }
private static Query BuildNumericRangeQuery(NumericRangeSearchParam.NumericRangeField range) { var startTerm = new Term(range.FieldName, NumberTools.LongToString(range.Start)); var endTerm = new Term(range.FieldName, NumberTools.LongToString(range.End)); return new RangeQuery(startTerm, endTerm, true); }