Project

General

Profile

« Previous | Next » 

Revision 8552

return null if there is no existing SolrDoc for the given pid.

View differences:

metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/resourcemap/ResourceMapSubprocessor.java
144 144
	public static SolrDoc getSolrDoc(String id) throws SolrServerException,
145 145
			IOException, ParserConfigurationException, SAXException,
146 146
			XPathExpressionException, NotImplemented, NotFound, UnsupportedType {
147
		SolrDoc doc = new SolrDoc();
147
		SolrDoc doc = null;
148 148

  
149 149
		if (solrServer != null) {
150 150
			String query = QUERY + "\"" + id + "\"";
......
152 152
			QueryResponse qr = solrServer.query(solrParams);
153 153
			if (qr.getResults().size() > 0) {
154 154
				SolrDocument orig = qr.getResults().get(0);
155
				doc = new SolrDoc();
155 156
				IndexSchema indexSchema = SolrQueryServiceController.getInstance().getSchema();
156 157
				for (String fieldName : orig.getFieldNames()) {
157 158
					// don't transfer the copyTo fields, otherwise there are errors

Also available in: Unified diff