Ejemplo n.º 1
0
 public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
 {
     Debug.Assert(cqpC != null, "Parameter must not be null");
     Debug.Assert(cqpC is QueryParser, "Parameter must be instance of QueryParser");
     QueryParser qp = (QueryParser)cqpC;
     return qp.Parse(query);
 }
Ejemplo n.º 2
0
 public override Query GetQuery(String query, ICommonQueryParserConfiguration cqpC)
 {
     Debug.Assert(cqpC != null, "Parameter must not be null");
     Debug.Assert((cqpC is StandardQueryParser), "Parameter must be instance of StandardQueryParser");
     StandardQueryParser qp = (StandardQueryParser)cqpC;
     return Parse(query, qp);
 }
 public void AssertDateRangeQueryEquals(ICommonQueryParserConfiguration cqpC, string field, string startDate, string endDate,
     DateTime endDateInclusive, DateTools.Resolution resolution)
 {
     AssertQueryEquals(cqpC, field, field + ":[" + EscapeDateString(startDate) + " TO " + EscapeDateString(endDate) + "]",
                "[" + GetDate(startDate, resolution) + " TO " + GetDate(endDateInclusive, resolution) + "]");
     AssertQueryEquals(cqpC, field, field + ":{" + EscapeDateString(startDate) + " TO " + EscapeDateString(endDate) + "}",
                "{" + GetDate(startDate, resolution) + " TO " + GetDate(endDate, resolution) + "}");
 }
Ejemplo n.º 4
0
        public override void SetDefaultOperatorOR(ICommonQueryParserConfiguration cqpC)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is StandardQueryParser);
            }
            StandardQueryParser qp = (StandardQueryParser)cqpC;

            qp.DefaultOperator = (Operator.OR);
        }
Ejemplo n.º 5
0
        public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is QueryParser);
            }
            QueryParser qp = (QueryParser)cqpC;

            qp.AnalyzeRangeTerms = (value);
        }
Ejemplo n.º 6
0
        public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is QueryParser);
            }
            QueryParser qp = (QueryParser)cqpC;

            qp.AutoGeneratePhraseQueries = value;
        }
Ejemplo n.º 7
0
        public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is QueryParser);
            }
            QueryParser qp = (QueryParser)cqpC;

            qp.DefaultOperator = Operator.AND;
        }
Ejemplo n.º 8
0
        public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, string field, DateTools.Resolution value)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is QueryParser);
            }
            QueryParser qp = (QueryParser)cqpC;

            qp.SetDateResolution(field, value);
        }
Ejemplo n.º 9
0
        public override void SetDateResolution(ICommonQueryParserConfiguration cqpC,
                                               string field, DateResolution value)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is StandardQueryParser);
            }
            StandardQueryParser qp = (StandardQueryParser)cqpC;

            qp.DateResolutionMap.Put(field, value);
        }
Ejemplo n.º 10
0
        public override Query GetQuery(string query, ICommonQueryParserConfiguration cqpC)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC != null, "Parameter must not be null");
            }
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC is QueryParser, "Parameter must be instance of QueryParser");
            }
            QueryParser qp = (QueryParser)cqpC;

            return(qp.Parse(query));
        }
Ejemplo n.º 11
0
        public override Query GetQuery(String query, ICommonQueryParserConfiguration cqpC)
        {
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(cqpC != null, () => "Parameter must not be null");
            }
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert((cqpC is StandardQueryParser), () => "Parameter must be instance of StandardQueryParser");
            }
            StandardQueryParser qp = (StandardQueryParser)cqpC;

            return(Parse(query, qp));
        }
Ejemplo n.º 12
0
 public override void SetDateResolution(ICommonQueryParserConfiguration cqpC,
     string field, DateTools.Resolution value)
 {
     Debug.Assert(cqpC is StandardQueryParser);
     StandardQueryParser qp = (StandardQueryParser)cqpC;
     qp.DateResolutionMap.Put(field, value);
 }
Ejemplo n.º 13
0
 public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC,
     bool value)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 14
0
 public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value)
 {
     Debug.Assert(cqpC is QueryParser);
     QueryParser qp = (QueryParser)cqpC;
     qp.AnalyzeRangeTerms = (value);
 }
Ejemplo n.º 15
0
 public abstract void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value);
Ejemplo n.º 16
0
 public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
 {
     Debug.Assert(cqpC is QueryParser);
     QueryParser qp = (QueryParser)cqpC;
     qp.DefaultOperator = QueryParserBase.Operator.AND;
 }
Ejemplo n.º 17
0
 public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC,
                                                   bool value)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 18
0
 public abstract void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC, bool value);
Ejemplo n.º 19
0
 public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC,
     bool value)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 20
0
 public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC,
                                                   bool value)
 {
     throw UnsupportedOperationException.Create();
 }
Ejemplo n.º 21
0
 public abstract void SetDateResolution(ICommonQueryParserConfiguration cqpC, string field, DateTools.Resolution value);
Ejemplo n.º 22
0
 public abstract Query GetQuery(string query, ICommonQueryParserConfiguration cqpC);
Ejemplo n.º 23
0
 public void AssertQueryEquals(ICommonQueryParserConfiguration cqpC, string field, string query, string result)
 {
     Query q = GetQuery(query, cqpC);
     string s = q.ToString(field);
     if (!s.Equals(result))
     {
         fail("Query /" + query + "/ yielded /" + s
              + "/, expecting /" + result + "/");
     }
 }
Ejemplo n.º 24
0
 public override void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC)
 {
     Debug.Assert(cqpC is StandardQueryParser);
     StandardQueryParser qp = (StandardQueryParser)cqpC;
     qp.DefaultOperator = (Operator.AND);
 }
Ejemplo n.º 25
0
 public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC,
                                           bool value)
 {
     throw UnsupportedOperationException.Create();
 }
Ejemplo n.º 26
0
 public override void SetAutoGeneratePhraseQueries(ICommonQueryParserConfiguration cqpC, bool value)
 {
     Debug.Assert(cqpC is QueryParser);
     QueryParser qp = (QueryParser)cqpC;
     qp.AutoGeneratePhraseQueries = value;
 }
Ejemplo n.º 27
0
 public override void SetDateResolution(ICommonQueryParserConfiguration cqpC, string field, DateTools.Resolution value)
 {
     Debug.Assert(cqpC is QueryParser);
     QueryParser qp = (QueryParser)cqpC;
     qp.SetDateResolution(field, value);
 }
Ejemplo n.º 28
0
 public override void SetAnalyzeRangeTerms(ICommonQueryParserConfiguration cqpC,
                                           bool value)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 29
0
 public abstract void SetDefaultOperatorAND(ICommonQueryParserConfiguration cqpC);