1 package org.kuali.ole.docstore.indexer.solr;
2
3 import org.apache.solr.client.solrj.SolrServerException;
4 import org.apache.solr.client.solrj.response.QueryResponse;
5 import org.apache.solr.common.SolrDocument;
6 import org.apache.solr.common.SolrInputDocument;
7 import org.kuali.ole.docstore.model.xmlpojo.ingest.RequestDocument;
8
9 import java.io.File;
10 import java.io.IOException;
11 import java.net.MalformedURLException;
12 import java.util.List;
13
14
15
16
17
18
19
20
21 public interface IndexerService {
22
23 public static final String SUCCESS = "success";
24 public static final String FAILURE = "failure";
25 public static final String UUID_FILE_NAME_SUFFIX = "_UUID_.xml";
26
27 public static final String ID_FIELD_PREFIX = "id_disc_";
28 public static final int BATCH_SIZE = 10000;
29 public static final String BIBLIOGRAPHIC = "bibliographic";
30 public static final String DOC_TYPE = "DocType";
31 public static final String DOC_FORMAT = "DocFormat";
32 public static final String HOLDINGS_IDENTIFIER = "holdingsIdentifier";
33 public static final String ITEM_IDENTIFIER = "itemIdentifier";
34 public static final String INSTANCE = "instance";
35
36
37
38
39
40
41
42
43
44 public String deleteDocuments(String docCategory, List<String> uuidList)
45 throws MalformedURLException, SolrServerException;
46
47
48
49
50
51
52
53
54 public String deleteDocument(String docCategory, String uuid);
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 public String indexDocumentsFromDirBySolrDoc(String docCategory, String docType, String docFormat, String dataDir);
72
73 public String indexDocumentsFromStringBySolrDoc(String docCategory, String docType, String docFormat, String data)
74 throws IOException;
75
76 public String indexDocumentsFromFileBySolrDoc(String docCategory, String docType, String docFormat,
77 String filePath);
78
79 public String indexDocumentsFromFiles(String docCategory, String docType, String docFormat, List<File> fileList);
80
81 public String indexDocuments(List<RequestDocument> requestDocuments);
82
83 public String indexDocuments(List<RequestDocument> requestDocuments, boolean commit);
84
85 public String indexDocument(RequestDocument requestDocument);
86
87 public String indexDocument(RequestDocument requestDocument, boolean commit);
88
89 public String indexSolrDocuments(List<SolrInputDocument> solrDocs);
90
91 public void commit() throws Exception;
92
93 public void rollback() throws Exception;
94
95
96
97
98
99
100
101 public String bulkIndexDocuments(List<RequestDocument> requestDocuments, boolean isCommit);
102
103 public List<SolrDocument> getSolrDocumentBySolrId(String uniqueId);
104
105
106
107 public List<SolrDocument> getSolrDocument(String fieldName, String fieldValue);
108
109 public QueryResponse searchBibRecord(String docCat, String docType, String docFormat, String fieldName,
110 String fieldValue, String fieldList);
111
112 public void cleanupDiscoveryData() throws IOException, SolrServerException;
113
114 public String bind(List<RequestDocument> requestDocument) throws Exception, IOException;
115
116 public String bind(RequestDocument requestDocument) throws Exception;
117
118 public String unbind(List<RequestDocument> requestDocuments) throws Exception;
119
120 public void transferInstances(List<RequestDocument> requestDocuments) throws Exception;
121
122 public void transferItems(List<RequestDocument> requestDocuments) throws Exception;
123
124 public String delete(List<RequestDocument> requestDocuments) throws Exception;
125
126 public String delete(RequestDocument requestDocument) throws SolrServerException, Exception;
127
128 public String buildUuid();
129 }