Project

General

Profile

« Previous | Next » 

Revision 55542

truncate ext values in SolrDocuments to 25000 characters

View differences:

modules/dnet-index-client/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
......
245 247
		if (text.isEndElement()) // log.warn("skipping because isEndOfElement " + text.asEndElement().getName().getLocalPart());
246 248
			return "";
247 249

  
248
		return text.asCharacters().getData();
250
		final String data = text.asCharacters().getData();
251
		if (data != null && data.length() > MAX_FIELD_LENGTH) {
252
			return data.substring(0, MAX_FIELD_LENGTH);
253
		}
254

  
255
		return data;
249 256
	}
250 257

  
251 258
}

Also available in: Unified diff