protected override IQueryNode PostProcessNode(IQueryNode node)
        {
            if (node is SlopQueryNode)
            {
                SlopQueryNode phraseSlopNode = (SlopQueryNode)node;

                if (!(phraseSlopNode.GetChild() is TokenizedPhraseQueryNode) &&
                    !(phraseSlopNode.GetChild() is MultiPhraseQueryNode))
                {
                    return(phraseSlopNode.GetChild());
                }
            }

            return(node);
        }
Пример #2
0
        public virtual Query Build(IQueryNode queryNode)
        {
            SlopQueryNode phraseSlopNode = (SlopQueryNode)queryNode;

            Query query = (Query)phraseSlopNode.GetChild().GetTag(
                QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);

            if (query is PhraseQuery)
            {
                ((PhraseQuery)query).Slop = phraseSlopNode.Value;
            }
            else
            {
                ((MultiPhraseQuery)query).Slop = phraseSlopNode.Value;
            }

            return(query);
        }