Examples of terms()


Examples of org.apache.lucene.index.AtomicReader.terms()

      startWith = "";
    }
    Term term = getTerm(columnFamily, columnName, startWith);
    List<String> terms = new ArrayList<String>(size);
    AtomicReader areader = BlurUtil.getAtomicReader(reader);
    Terms termsAll = areader.terms(term.field());
    TermsEnum termEnum = termsAll.iterator(null);
    BytesRef currentTermText;
    while ((currentTermText = termEnum.next()) != null) {
      terms.add(currentTermText.utf8ToString());
      if (terms.size() >= size) {
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

    for (String fieldName : fields) {
      if (fieldName.equals(DocMaker.ID_FIELD) || fieldName.equals(DocMaker.DATE_MSEC_FIELD) || fieldName.equals(DocMaker.TIME_SEC_FIELD)) {
        continue;
      }
      Terms terms = fields.terms(fieldName);
      if (terms == null) {
        continue;
      }
      TermsEnum termsEnum = terms.iterator(null);
      DocsEnum docs = null;
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

      if (termVectorsToFetch != null && termVectorsToFetch.size() > 0) {
        Map<String, List<BoboTerm>> tvMap = new HashMap<String, List<BoboTerm>>();
        hit.setTermVectorMap(tvMap);
        Fields fds = reader.getTermVectors(fdoc.doc);
        for (String field : termVectorsToFetch) {
          Terms terms = fds.terms(field);
          if (terms == null) {
            continue;
          }
          TermsEnum termsEnum = terms.iterator(null);
          BytesRef text;
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

    Fields fields = MultiFields.getFields(reader);   
    TermsEnum te = null;
    for (String fld : fields) {
      FieldTermCount ftc = new FieldTermCount();
      ftc.fieldname = fld;
      Terms terms = fields.terms(fld);
      if (terms != null) { // count terms
        te = terms.iterator(te);
        while (te.next() != null) {
          ftc.termCount++;
          numTerms++;
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

        LOG.info("Index with no fields - probably empty or corrupted");
        return EMPTY_STATS;
      }
      tiq = new TermStatsQueue(numTerms);
      for (String field : fieldNames) {
        Terms terms = fields.terms(field);
        if (terms != null) {
          te = terms.iterator(te);
          fillQueue(te, tiq, field);
        }
      }
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

      }
      tiq = new TermStatsQueue(numTerms);     
      while (true) {
        String field = fields.iterator().next();
        if (field != null) {
          Terms terms = fields.terms(field);
          te = terms.iterator(te);
          fillQueue(te, tiq, field);
        } else {
          break;
        }
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

      if (fields == null) {
        // reader has no fields
        continue;
      }

      final Terms terms = fields.terms(query.field);
      if (terms == null) {
        // field does not exist
        continue;
      }
View Full Code Here

Examples of org.apache.lucene.index.Fields.terms()

      int numberOfShards = _shardContext.getTableContext().getDescriptor().getShardCount();
      int shardId = BlurUtil.getShardIndex(shard);
      for (AtomicReaderContext context : leaves) {
        AtomicReader atomicReader = context.reader();
        Fields fields = atomicReader.fields();
        Terms terms = fields.terms(BlurConstants.ROW_ID);
        if (terms != null) {
          TermsEnum termsEnum = terms.iterator(null);
          BytesRef ref = null;
          while ((ref = termsEnum.next()) != null) {
            key.set(ref.bytes, ref.offset, ref.length);
View Full Code Here

Examples of org.apache.lucene.index.FilterIndexReader.terms()

      ConstantScoreRangeQuery q = (ConstantScoreRangeQuery) query;
      Term lower = new Term(fieldName, q.getLowerVal());
      Term upper = new Term(fieldName, q.getUpperVal());
      FilterIndexReader fir = new FilterIndexReader(getReaderForField(fieldName));
      try {
        TermEnum te = fir.terms(lower);
        BooleanQuery bq = new BooleanQuery();
        do {
          Term term = te.term();
          if (term != null && upper.compareTo(term) >= 0) {
            bq.add(new BooleanClause(new TermQuery(term), BooleanClause.Occur.SHOULD));
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.terms()

   */
  public static void main(String[] args) throws Exception {
    addIndex();
    IndexReader reader = IndexReader.open(lucenePath);
    System.out.println("�ĵ���:"+reader.numDocs());
    TermEnum tes = reader.terms();
    while(tes.next()){
      Term t = tes.term();
      System.out.println(t.toString());
    }
    //IndexSearcher searcher = new IndexSearcher(lucenePath);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.