1 |
29686
|
sandro.lab
|
package eu.dnetlib.functionality.index.feed;
|
2 |
|
|
|
3 |
|
|
import java.util.Collection;
|
4 |
|
|
import java.util.Iterator;
|
5 |
|
|
|
6 |
|
|
import eu.dnetlib.data.provision.index.rmi.IndexServiceException;
|
7 |
|
|
import eu.dnetlib.functionality.index.model.document.IndexDocument;
|
8 |
|
|
|
9 |
|
|
public interface IndexFeederCollection {
|
10 |
|
|
|
11 |
|
|
/**
|
12 |
|
|
* Adds an input Document to the index.
|
13 |
|
|
*
|
14 |
|
|
* @param doc
|
15 |
|
|
* the doc
|
16 |
|
|
* @return the solr update response
|
17 |
|
|
* @throws IndexServiceException
|
18 |
|
|
* the index service exception
|
19 |
|
|
*/
|
20 |
|
|
public boolean add(final IndexDocument doc) throws IndexServiceException;
|
21 |
|
|
|
22 |
|
|
/**
|
23 |
|
|
* Adds all the documents to the index giving an iterator of input documents.
|
24 |
|
|
*
|
25 |
|
|
* @param docs
|
26 |
|
|
* the iterator of input documents
|
27 |
|
|
* @return the solr update response
|
28 |
|
|
* @throws IndexServiceException
|
29 |
|
|
* the index service exception
|
30 |
|
|
*/
|
31 |
|
|
public boolean addAll(final Iterator<IndexDocument> docs) throws IndexServiceException;
|
32 |
|
|
|
33 |
|
|
/**
|
34 |
|
|
* Adds the all.
|
35 |
|
|
*
|
36 |
|
|
* @param docs
|
37 |
|
|
* the docs
|
38 |
|
|
* @return the update response
|
39 |
|
|
* @throws IndexServiceException
|
40 |
|
|
* the index service exception
|
41 |
|
|
*/
|
42 |
|
|
public boolean addAll(final Collection<IndexDocument> docs) throws IndexServiceException;
|
43 |
|
|
|
44 |
|
|
/**
|
45 |
|
|
* Delete index.
|
46 |
|
|
*
|
47 |
|
|
* @param dsId
|
48 |
|
|
* the ds id
|
49 |
|
|
* @return true, if successful
|
50 |
|
|
* @throws IndexServiceException
|
51 |
|
|
* the index service exception
|
52 |
|
|
*/
|
53 |
|
|
public boolean deleteIndex(final String dsId) throws IndexServiceException;
|
54 |
|
|
|
55 |
|
|
/**
|
56 |
|
|
* Delete data from the index by query.
|
57 |
|
|
*
|
58 |
|
|
* @param query
|
59 |
|
|
* the query
|
60 |
|
|
* @param dsId
|
61 |
|
|
* the ds id
|
62 |
|
|
* @return true, if successful
|
63 |
|
|
* @throws IndexServiceException
|
64 |
|
|
* the index service exception
|
65 |
|
|
*/
|
66 |
|
|
public boolean deleteByQuery(final String query, final String dsId) throws IndexServiceException;
|
67 |
|
|
|
68 |
|
|
/**
|
69 |
|
|
* Commit the data.
|
70 |
|
|
*
|
71 |
|
|
* @return true, if successful
|
72 |
|
|
* @throws IndexServiceException
|
73 |
|
|
* the index service exception
|
74 |
|
|
*/
|
75 |
|
|
public boolean commit() throws IndexServiceException;
|
76 |
|
|
|
77 |
|
|
}
|