Project

General

Profile

« Previous | Next » 

Revision 8739

Added by Jing Tao over 10 years ago

Index the document after it has been inserted.

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
624 624
			String homeServer = (String) docinfoHash.get("home_server");
625 625
			
626 626
			// process system metadata
627
			SystemMetadata sysMeta = null;
627 628
			if (systemMetadataXML != null) {
628
				SystemMetadata sysMeta = 
629
				sysMeta = 
629 630
					TypeMarshaller.unmarshalTypeFromStream(
630 631
							SystemMetadata.class,
631 632
							new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
......
637 638
		      	}
638 639
				// save the system metadata
639 640
				HazelcastService.getInstance().getSystemMetadataMap().put(sysMeta.getIdentifier(), sysMeta);
640
				// submit for indexing
641
                MetacatSolrIndex.getInstance().submit(sysMeta.getIdentifier(), sysMeta, null, true);
641
				
642 642
			}
643 643
      
644 644
			// dates
......
684 684
						dbaction, docid, null, null, homeServer, server, createdDate,
685 685
						updatedDate);
686 686
			} finally {
687

  
687
				if(sysMeta != null) {
688
					// submit for indexing. When the doc writing process fails, the index process will fail as well. But this failure
689
					// will not interrupt the process.
690
					try {
691
						MetacatSolrIndex.getInstance().submit(sysMeta.getIdentifier(), sysMeta, null, true);
692
					} catch (Exception ee) {
693
						logReplication.warn("ReplicationService.handleForceReplicateRequest - couldn't index the doc since "+ee.getMessage());
694
					}
695
	                
696
				}
688 697
				//process extra access rules before dealing with the write exception (doc exist already)
689 698
				try {
690 699
		        	// check if we had a guid -> docid mapping

Also available in: Unified diff