private SectionSearchQueryPlan Translate(Query query)
        {
            if (query != null)
            {
                if (query is TermQuery)
                {
                    return(TranslateTermQuery((TermQuery)query));
                }
                else if (query is PhraseQuery)
                {
                    return(TranslatePhraseQuery((PhraseQuery)query));
                }
                else if (query is BooleanQuery)
                {
                    return(TranslateBooleanQuery((BooleanQuery)query));
                }
                else if (query is MetaDataQuery)
                {
                    MetaDataQuery  mquery = (MetaDataQuery)query;
                    IMetaDataCache cache  = (m_cacheProvider != null ? m_cacheProvider.Get(mquery.Term) : null);

                    if (cache != null)
                    {
                        return(((MetaDataQuery)query).GetPlan(cache));
                    }
                    else
                    {
                        return(((MetaDataQuery)query).GetPlan(m_reader));
                    }
                }
                else
                {
                    throw new TranslationException("unable to translate Query class: " + query.GetType().Name);
                }
            }
            return(null);
        }
 public override SectionSearchQueryPlan GetPlan(IMetaDataCache cache)
 {
     return new IntMetaDataNode((IntMetaDataCache)cache, _validator);
 }
Example #3
0
 public abstract SectionSearchQueryPlan GetPlan(IMetaDataCache cache);
 public abstract SectionSearchQueryPlan GetPlan(IMetaDataCache cache);
 public override SectionSearchQueryPlan GetPlan(IMetaDataCache cache)
 {
     return(new IntMetaDataNode((IntMetaDataCache)cache, _validator));
 }