Project

General

Profile

« Previous | Next » 

Revision 55543

truncate ext values in SolrDocuments to 25000 characters

View differences:

modules/dnet-index-solr-common/branches/solr75/src/main/java/eu/dnetlib/functionality/index/solr/feed/StreamingInputDocumentFactory.java
44 44

  
45 45
	protected static final String ROOT_ELEMENT = "indexRecord";
46 46

  
47
	protected static final int MAX_FIELD_LENGTH = 25000;
48

  
47 49
	protected ThreadLocal<XMLInputFactory> inputFactory = new ThreadLocal<XMLInputFactory>() {
48 50

  
49 51
		@Override
......
257 259
		if (text.isEndElement()) // log.warn("skipping because isEndOfElement " + text.asEndElement().getName().getLocalPart());
258 260
			return "";
259 261

  
260
		return text.asCharacters().getData();
262
		final String data = text.asCharacters().getData();
263
		if (data != null && data.length() > MAX_FIELD_LENGTH) {
264
			return data.substring(0, MAX_FIELD_LENGTH);
265
		}
266

  
267
		return data;
261 268
	}
262 269

  
263 270
}

Also available in: Unified diff