Package org.apache.accumulo.examples.wikisearch.sample

Examples of org.apache.accumulo.examples.wikisearch.sample.Field


    String type = colf.substring(0, idx);
    String id = colf.substring(idx + 1);
    doc.setId(id);
    for (Entry<String,Collection<FieldValue>> entry : eventFields.asMap().entrySet()) {
      for (FieldValue fv : entry.getValue()) {
        Field val = new Field();
        val.setFieldName(entry.getKey());
        val.setFieldValue(new String(fv.getValue(), Charset.forName("UTF-8")));
        doc.getFields().add(val);
      }
    }
   
    // Add the pointer for the content.
    Field docPointer = new Field();
    docPointer.setFieldName("DOCUMENT");
    docPointer.setFieldValue("DOCUMENT:" + row + "/" + type + "/" + id);
    doc.getFields().add(docPointer);
   
    return doc;
  }
View Full Code Here


        scanner.setRange(r);
        // This should in theory only match one thing.
        for (Entry<Key,Value> entry : scanner) {
          Document doc = new Document();
          doc.setId(id);
          Field val = new Field();
          val.setFieldName("DOCUMENT");
          val.setFieldValue(new String(Base64.decodeBase64(entry.getValue().toString())));
          doc.getFields().add(val);
          results.getResults().add(doc);
        }
      } catch (TableNotFoundException e) {
        throw new RuntimeException("Table not found: " + this.getTableName(), e);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.examples.wikisearch.sample.Field

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.