Package org.apache.lucene.search.spans

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


        SpanTermQuery stq = new SpanTermQuery(new Term(fieldName, BytesRef.deepCopyOf(bytes)));
        clausesList.add(stq);
      }
      ts.end();
      ts.close();
      SpanOrQuery soq = new SpanOrQuery(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


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

      sqs[i] = new SpanTermQuery(tq.getTerm());
      sqs[i].setBoost(tq.getBoost());
    }

    SpanOrQuery query = new SpanOrQuery(sqs);
    query.setBoost(orig.getBoost());

    return query;
  }
View Full Code Here

      {
          SpanTermQuery stq=new SpanTermQuery(new Term(fieldName,token.termText()));
          clausesList.add(stq);
        token=ts.next();       
      }
      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

  }
   
  // LUCENE-3831
  public void testPassesIfWrapped() throws IOException {
    RegexpQuery regex = new RegexpQuery(new Term("field", "worl."));
    SpanQuery wrappedquery = new SpanOrQuery(new SpanMultiTermQueryWrapper<RegexpQuery>(regex));

    MemoryIndex mindex = new MemoryIndex(random().nextBoolean(),  random().nextInt(50) * 1024 * 1024);
    mindex.addField("field", new MockAnalyzer(random()).tokenStream("field", "hello there"));

    // This passes though
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

      {
          SpanTermQuery stq=new SpanTermQuery(new Term(fieldName,token.termText()));
          clausesList.add(stq);
        token=ts.next();       
      }
      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

      sqs[i] = new SpanTermQuery(tq.getTerm());
      sqs[i].setBoost(tq.getBoost());
    }

    SpanOrQuery query = new SpanOrQuery(sqs);
    query.setBoost(orig.getBoost());

    return query;
  }
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

        int position = 0;
        final SpanQuery[] clauses = new SpanQuery[distinctPositions];
        for (int i = 0; i < disjunctLists.length; ++i) {
          List<Query> disjuncts = disjunctLists[i];
          if (disjuncts != null) {
            clauses[position++] = new SpanOrQuery(disjuncts
                .toArray(new SpanQuery[disjuncts.size()]));
          } else {
            ++positionGaps;
          }
        }
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.