public WctEnricher( String archiveName ) { String wctID = this.getWctTi( archiveName ); solr = SolrRecordFactory.createFactory(null).createRecord(); // Never reduces field length size solr.setField( WctFields.WCT_INSTANCE_ID, wctID ); getWctMetadata( solr ); }
/** * Add any non-null string properties, stripping control characters if present. * * @param solr_property * @param value */ public void addField(String solr_property, String value) { addFieldTruncated(solr_property, value, getMaxLength(solr_property)); }
/** * Set instead of adding fields. * * @param solr_property * @param value */ public void setField(String solr_property, String value) { setFieldTruncated(solr_property, value, getMaxLength(solr_property)); }
@Override public void readFields( DataInput input ) throws IOException { int length = input.readInt(); byte[] bytes = new byte[ length ]; input.readFully( bytes ); if( this.sr == null) { this.sr = SolrRecordFactory.createFactory(null).createRecord(); } this.sr.setSolrDocument( ( SolrInputDocument ) SerializationUtils.deserialize( bytes ) ); }
@Override public UpdateResponse add( SolrInputDocument doc ) throws SolrServerException, IOException { if( checkMemory( doc ) ) flush(); this.docs.add( doc ); return checkQueue(); }
public SolrRecord createRecord(String filename, ArchiveRecordHeader header) { return new SolrRecord(defaultMax, maxLengths, filename, header); }
/** * * @return */ public String getUrl() { return (String) getField(SolrFields.SOLR_URL).getFirstValue(); }
public static SolrRecordFactory createFactory(Config config) { return new SolrRecordFactory(config); }
public void write(char[] cbuf, int off, int len) throws IOException { for (int i = off; i < len; i++) write(cbuf[i]); }
public WctEnricher( String archiveName ) { String wctID = this.getWctTi( archiveName ); solr = SolrRecordFactory.createFactory(null).createRecord(); // Never reduces field length size solr.setField( WctFields.WCT_INSTANCE_ID, wctID ); getWctMetadata( solr ); }
@Override public UpdateResponse add( Collection<SolrInputDocument> docs ) throws SolrServerException, IOException { for( SolrInputDocument doc : docs ) { if( checkMemory( doc ) ) flush(); this.docs.add( doc ); } return checkQueue(); }
public SolrRecord createRecord() { return new SolrRecord(defaultMax, maxLengths); }
/** * * @return */ public String getWaybackDate() { return (String) getField(SolrFields.WAYBACK_DATE).getFirstValue(); }
/** * Add any non-null string properties, stripping control characters if present. * * @param solr_property * @param value */ public void addField(String solr_property, String value) { addFieldTruncated(solr_property, value, getMaxLength(solr_property)); }
/** * Set instead of adding fields. * * @param solr_property * @param value */ public void setField(String solr_property, String value) { setFieldTruncated(solr_property, value, getMaxLength(solr_property)); }
public static SolrRecordFactory createFactory(Config config) { return new SolrRecordFactory(config); }
public SolrRecord createRecord() { return new SolrRecord(defaultMax, maxLengths); }
/** * * @return */ public String getHost() { return (String) getField(SolrFields.SOLR_HOST).getFirstValue(); }
public SolrRecord createRecord(String filename, ArchiveRecordHeader header) { return new SolrRecord(defaultMax, maxLengths, filename, header); }
/** * * @return */ public String getUrl() { return (String) getField(SolrFields.SOLR_URL).getFirstValue(); }