Package org.solbase.indexer.writable

Examples of org.solbase.indexer.writable.DocumentPutWritable


      ParsedDoc parsedDoc = indexerUtil.getIndexWriter().parseDoc(doc, indexerUtil.getAnalyzer(), "", docId, indexerUtil.getSortFieldNames());

      List<TermDocMetadata> metadatas = parsedDoc.getTermDocMetadatas();
     
      MapWritable mapWritable = new MapWritable();
      DocumentPutWritable docWritable = new DocumentPutWritable(parsedDoc.getFieldsMap(), parsedDoc.getAllTerms(), docId, globalId);
      mapWritable.put(new BytesWritable(Bytes.toBytes("doc")), docWritable);

      for (TermDocMetadata metadata : metadatas) {
        byte[] key = metadata.getFieldTermKey();
        ByteBuffer buf = metadata.serialize();
View Full Code Here


        while (itr.hasNext()) {
          BytesWritable wrtKey = (BytesWritable) itr.next();
          Writable wrt = writable.get(wrtKey);
          if (wrt instanceof DocumentPutWritable) {
            DocumentPutWritable docBytes = (DocumentPutWritable) wrt;

            String globalId = docBytes.getGlobalId();
            int docId = docBytes.getDocId();

            Put mapping = new Put(Bytes.toBytes(globalId));
            mapping.add(Bytes.toBytes("docId"), Bytes.toBytes(""), Bytes.toBytes(docId));
            context.write(new ImmutableBytesWritable(SolbaseUtil.docKeyIdMapTable), mapping);
            context.getCounter(Counters.TOTAL_DOC_KEY_ID_MAP).increment(1);

            List<String> fieldKeys = docBytes.getFieldKeys();
            List<byte[]> fieldValues = docBytes.getFieldValues();
            List<Term> allTerms = docBytes.getAllTerms();

            byte[] md5DocId = SolbaseUtil.randomize(docId);

            Put documentPut = new Put(md5DocId);
View Full Code Here

TOP

Related Classes of org.solbase.indexer.writable.DocumentPutWritable

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.