Factory for disjunctions
Inheritance: ComposedQuery, IDistanceSubQuery
 public virtual Search.Query MakeLuceneQueryNoBoost(BasicQueryFactory qf)
 {
     if (fieldNames.Count() == 1)
     { /* single field name: no new queries needed */
         return q.MakeLuceneQueryFieldNoBoost(fieldNames.FirstOrDefault(), qf);
     }
     else
     { /* OR query over the fields */
         List<SrndQuery> queries = new List<SrndQuery>();
         foreach (var fieldName in fieldNames)
         {
             var qc = (SrndQuery)q.Clone();
             queries.Add(new FieldsQuery(qc, fieldName, fieldOp));
         }
         OrQuery oq = new OrQuery(queries,
                                 true /* infix OR for field names */,
                                 OrOperatorName);
         // System.out.println(getClass().toString() + ", fields expanded: " + oq.toString()); /* needs testing */
         return oq.MakeLuceneQueryField(null, qf);
     }
 }
Beispiel #2
0
 public virtual Search.Query MakeLuceneQueryNoBoost(BasicQueryFactory qf)
 {
     if (fieldNames.Count == 1)
     { /* single field name: no new queries needed */
         return(q.MakeLuceneQueryFieldNoBoost(fieldNames.FirstOrDefault(), qf));
     }
     else
     { /* OR query over the fields */
         List <SrndQuery> queries = new List <SrndQuery>();
         foreach (var fieldName in fieldNames)
         {
             var qc = (SrndQuery)q.Clone();
             queries.Add(new FieldsQuery(qc, fieldName, fieldOp));
         }
         OrQuery oq = new OrQuery(queries,
                                  true /* infix OR for field names */,
                                  orOperatorName);
         // System.out.println(getClass().toString() + ", fields expanded: " + oq.toString()); /* needs testing */
         return(oq.MakeLuceneQueryField(null, qf));
     }
 }