Package org.apache.lucene.search.spans

Examples of org.apache.lucene.search.spans.SpanOrQuery


    }
   
    if (spanQueries.length == 1)
      return spanQueries[0];
    else
      return new SpanOrQuery(spanQueries);
  }
View Full Code Here


        }
      }
      if (ors.size() == 0) {
        return;
      }
      SpanOrQuery soq = new SpanOrQuery(ors
          .toArray(new SpanQuery[ors.size()]));
      if (nots.size() == 0) {
        spanClauses.add(soq);
      } else {
        SpanOrQuery snqs = new SpanOrQuery(nots
            .toArray(new SpanQuery[nots.size()]));
        SpanNotQuery snq = new SpanNotQuery(soq, snqs);
        spanClauses.add(snq);
      }
    }
View Full Code Here

  public SpanOrQuery sor(String s, String e) {
    return sor(st(s), st(e));
  }
  /** MACRO for SpanOrQuery containing two SpanQueries */
  public SpanOrQuery sor(SpanQuery s, SpanQuery e) {
    return new SpanOrQuery(new SpanQuery[] { s, e });
  }
View Full Code Here

  public SpanOrQuery sor(String s, String m, String e) {
    return sor(st(s), st(m), st(e));
  }
  /** MACRO for SpanOrQuery containing two SpanQueries */
  public SpanOrQuery sor(SpanQuery s, SpanQuery m, SpanQuery e) {
    return new SpanOrQuery(new SpanQuery[] { s, m, e });
  }
View Full Code Here

  public SpanOrQuery sor(String s, String e) {
    return sor(st(s), st(e));
  }
  /** MACRO for SpanOrQuery containing two SpanQueries */
  public SpanOrQuery sor(SpanQuery s, SpanQuery e) {
    return new SpanOrQuery(new SpanQuery[] { s, e });
  }
View Full Code Here

  public SpanOrQuery sor(String s, String m, String e) {
    return sor(st(s), st(m), st(e));
  }
  /** MACRO for SpanOrQuery containing two SpanQueries */
  public SpanOrQuery sor(SpanQuery s, SpanQuery m, SpanQuery e) {
    return new SpanOrQuery(new SpanQuery[] { s, m, e });
  }
View Full Code Here

        SpanQuery clause=factory.getSpanQuery((Element) kid);
        clausesList.add(clause);       
      }
    }     
    SpanQuery[] clauses=(SpanQuery[]) clausesList.toArray(new SpanQuery[clausesList.size()]);
    SpanOrQuery soq = new SpanOrQuery(clauses);   
    soq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
    return soq;
  }
View Full Code Here

     
      while (ts.incrementToken()) {
          SpanTermQuery stq=new SpanTermQuery(new Term(fieldName, termAtt.term()));
          clausesList.add(stq);
      }
      SpanOrQuery soq=new SpanOrQuery((SpanQuery[]) clausesList.toArray(new SpanQuery[clausesList.size()]));
      soq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
      return soq;
    }
    catch(IOException ioe)
    {
        throw new ParserException("IOException parsing value:"+value);
View Full Code Here

        int position = 0;
        final SpanQuery[] clauses = new SpanQuery[distinctPositions];
        for (int i = 0; i < disjunctLists.length; ++i) {
          List disjuncts = disjunctLists[i];
          if (disjuncts != null) {
            clauses[position++] = new SpanOrQuery((SpanQuery[]) disjuncts
                .toArray(new SpanQuery[disjuncts.size()]));
          } else {
            ++positionGaps;
          }
        }
View Full Code Here

        }
      }
      if (ors.size() == 0) {
        return;
      }
      SpanOrQuery soq = new SpanOrQuery((SpanQuery[]) ors
          .toArray(new SpanQuery[ors.size()]));
      if (nots.size() == 0) {
        spanClauses.add(soq);
      } else {
        SpanOrQuery snqs = new SpanOrQuery((SpanQuery[]) nots
            .toArray(new SpanQuery[nots.size()]));
        SpanNotQuery snq = new SpanNotQuery(soq, snqs);
        spanClauses.add(snq);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.spans.SpanOrQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.