Package org.apache.lucene.document

Examples of org.apache.lucene.document.DocumentStoredFieldVisitor


  }

  @Override
  protected void map(Text key, NullWritable text, Context context) throws IOException, InterruptedException {
    int docId = Integer.valueOf(key.toString());
    DocumentStoredFieldVisitor storedFieldVisitor = l2sConf.getStoredFieldVisitor();
    segmentReader.document(docId, storedFieldVisitor);
    Document document = storedFieldVisitor.getDocument();
    List<String> fields = l2sConf.getFields();
    Text theKey = new Text(Strings.nullToEmpty(document.get(l2sConf.getIdField())));
    Text theValue = new Text();
    LuceneSeqFileHelper.populateValues(document, theValue, fields);
    //if they are both empty, don't write
View Full Code Here


  }

  public DocumentStoredFieldVisitor getStoredFieldVisitor() {
    Set<String> fieldSet = Sets.newHashSet(idField);
    fieldSet.addAll(fields);
    return new DocumentStoredFieldVisitor(fieldSet);
  }
View Full Code Here

    }

    @Override
    public void collect(int docNum) throws IOException {
      if (processedDocs < lucene2seqConf.getMaxHits()) {
        final DocumentStoredFieldVisitor storedFieldVisitor = lucene2seqConf.getStoredFieldVisitor();
        arc.reader().document(docNum, storedFieldVisitor);

        Document doc = storedFieldVisitor.getDocument();
        List<String> fields = lucene2seqConf.getFields();
        Text theKey = new Text(Strings.nullToEmpty(doc.get(lucene2seqConf.getIdField())));
        Text theValue = new Text();
        LuceneSeqFileHelper.populateValues(doc, theValue, fields);
        //if they are both empty, don't write
View Full Code Here

  }

  public DocumentStoredFieldVisitor getStoredFieldVisitor() {
    Set<String> fieldSet = Sets.newHashSet(idField);
    fieldSet.addAll(fields);
    return new DocumentStoredFieldVisitor(fieldSet);
  }
View Full Code Here

    }

    @Override
    public void collect(int docNum) throws IOException {
      if (processedDocs < lucene2seqConf.getMaxHits()) {
        final DocumentStoredFieldVisitor storedFieldVisitor = lucene2seqConf.getStoredFieldVisitor();
        arc.reader().document(docNum, storedFieldVisitor);

        Document doc = storedFieldVisitor.getDocument();
        List<String> fields = lucene2seqConf.getFields();
        Text theKey = new Text(Strings.nullToEmpty(doc.get(lucene2seqConf.getIdField())));
        Text theValue = new Text();
        LuceneSeqFileHelper.populateValues(doc, theValue, fields);
        //if they are both empty, don't write
View Full Code Here

      }
    }
  }

  public String[] getStoredFieldValue(int docid, final String fieldname) throws IOException {
    DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor(fieldname);
    super.document(docid, visitor);
    Document doc = visitor.getDocument();
    return doc.getValues(fieldname);
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.document.DocumentStoredFieldVisitor

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.