public override BooleanQuery ProcessQuery(QueryOccurance occurance, Index index)
        {
            var outerQuery = new BooleanQuery();

             var refinementQuery = ApplyRefinements(Refinements, InnerCondition);

             var translator = new QueryTranslator(index);
             var refBooleanQuery = translator.ConvertCombinedQuery(refinementQuery);
             var outerOccurance = translator.GetOccur(occurance);

             if (refBooleanQuery != null && refBooleanQuery.Clauses().Count > 0)
            outerQuery.Add(refBooleanQuery, outerOccurance);

             var baseQuery = base.ProcessQuery(occurance, index);
             if (baseQuery != null)
            outerQuery.Add(baseQuery, outerOccurance);

             return outerQuery;
        }
示例#2
0
        public virtual BooleanQuery ProcessQuery(QueryOccurance occurance, Index index)
        {
            var innerQuery = new CombinedQuery();
            ApplyFullTextClause(innerQuery, FullTextQuery, occurance);
            ApplyRelationFilter(innerQuery, RelatedIds, occurance);
            ApplyTemplateFilter(innerQuery, TemplateIds, occurance);
            ApplyLocationFilter(innerQuery, LocationIds, occurance);
            AddFieldValueClause(innerQuery, BuiltinFields.Database, Database, occurance);

            if (innerQuery.Clauses.Count < 1)
                return null;

            var translator = new QueryTranslator(index);
            var booleanQuery = translator.ConvertCombinedQuery(innerQuery);

            ApplyLanguageClause(booleanQuery, Language, translator.GetOccur(occurance));

            return booleanQuery;
        }