Exemple #1
0
 public override Query VisitWildcardQuery(WildcardQuery wildcardq)
 {
     var term = wildcardq.GetTerm();
     var visited = VisitTerm(term);
     if (term == visited)
         return wildcardq;
     if (visited == null)
         return null;
     return new WildcardQuery(visited);
 }
Exemple #2
0
 public virtual Query VisitWildcardQuery(WildcardQuery wildcardq)
 {
     var term = wildcardq.GetTerm();
     var visited = VisitTerm(term);
     if (term == visited)
         return wildcardq;
     return new WildcardQuery(visited);
 }
Exemple #3
0
        public override Query VisitWildcardQuery(WildcardQuery wildcardq)
        {
            _text.Append(TermToString(wildcardq.GetTerm()));
            _text.Append(BoostToString(wildcardq.GetBoost()));

            return base.VisitWildcardQuery(wildcardq);
        }
Exemple #4
0
        public override Query VisitWildcardQuery(WildcardQuery wildcardq)
        {
            var pattern = wildcardq.GetTerm().Text();

            if (pattern.Contains("?"))
                throw new NotSupportedException("Cannot compile WildcardQuery, which contains '?', to SQL expression");

            if (pattern.StartsWith("*") && pattern.EndsWith("*"))
                _operators.Push("%LIKE%");
            else if (pattern.StartsWith("*"))
                _operators.Push("%LIKE");
            else if (pattern.EndsWith("*"))
                _operators.Push("LIKE%");

            var q = base.VisitWildcardQuery(wildcardq);
            _operators.Pop();
            return q;
        }