Пример #1
0
 public override DocSetIterator Search(IInvertedIndex index, bool ignoreNegation = false)
 {
     if (ignoreNegation)
     {
         return(index.All());
     }
     return(Negated ? new EmptyIterator() : index.All());
 }
Пример #2
0
            public override DocSetIterator Search(IInvertedIndex index, bool ignoreNegation = false)
            {
                var iterator = index.Get(Literal);

                if (Negated && !ignoreNegation)
                {
                    if (!index.AllowAll)
                    {
                        throw new NotSupportedException("Negative literal outside conjunction not supported");
                    }
                    iterator = new ButNotIterator(index.All(), iterator);
                }

                return(iterator);
            }