예제 #1
0
        private bool CollectResourcesForTerms(QueryGroup group)
        {
            TermCollector collector = new TermCollector(group);


            ICollection requiredTerms = collector.RequiredTerms;
            ICollection optionalTerms = collector.OptionalTerms;

            IDictionary requiredResourcesIndexedByNode = itsResourceMap.GetResourcesDenotedBy(requiredTerms);

            if (requiredResourcesIndexedByNode.Keys.Count != requiredTerms.Count)
            {
                return(false);
            }

            IDictionary optionalResourcesIndexedByNode = itsResourceMap.GetResourcesDenotedBy(optionalTerms);

            itsResourcesIndexedByNode = requiredResourcesIndexedByNode;
            foreach (Node node in optionalResourcesIndexedByNode.Keys)
            {
                itsResourcesIndexedByNode[node] = optionalResourcesIndexedByNode[node];
            }

            return(true);
        }