diff --git a/pom.xml b/pom.xml
index 9f6d57b4b..e233f9626 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
com.google.guava
guava
- 33.7.1-jre
+ 33.7.2-jre
org.apache.commons
diff --git a/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java b/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
index ac1f3238b..16e30791f 100644
--- a/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
+++ b/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
@@ -226,7 +226,7 @@ private void reconcileMorgueRecords(MorgueIndexer morgueIndex) {
if (removed > 0) {
LOG.info("Removed {} stale tombstone(s) from the morgue index", removed);
}
- } catch (SolrServerException | IOException ex) {
+ } catch (SolrServerException | RemoteSolrException | IOException ex) {
LOG.warn("Could not reconcile the morgue index with the live index", ex);
}
}
@@ -289,6 +289,10 @@ void startImport() throws MalformedURLException {
} finally {
try {
solrBridge.commit();
+ } catch (SolrServerException | RemoteSolrException | IOException e) {
+ LOG.error("cannot commit:\n", e);
+ }
+ try {
reconcileMorgueRecords(morgueLookup);
buildSuggesterIndex();
solrBridge.commit();
@@ -296,7 +300,7 @@ void startImport() throws MalformedURLException {
if (e instanceof SocketTimeoutException || e.getCause() instanceof SocketTimeoutException) {
LOG.warn("Retrieved a timeout while waiting for building of autocompletion index to complete.", e);
} else {
- LOG.error("cannot commit:\n", e);
+ LOG.error("Could not build the autocompletion index:\n", e);
}
} finally {
resourceAvailabilityCheckerMonitor.shutdown();
@@ -646,9 +650,9 @@ protected List> getFilesFromDataRoot(File rootFile) {
* Builds suggester index for autocompletion
*
* @throws SolrServerException
- * @throws MalformedURLException
+ * @throws IOException
*/
- private void buildSuggesterIndex() throws SolrServerException, MalformedURLException, IOException {
+ private void buildSuggesterIndex() throws SolrServerException, IOException {
LOG.info("Building index for autocompletion.");
HashMap paramMap = new HashMap<>();
paramMap.put("qt", "/suggest");
@@ -661,10 +665,10 @@ private void buildSuggesterIndex() throws SolrServerException, MalformedURLExcep
* Updates documents in Solr with their hierarchy weight and lists of
* related resources (hasPart & isPartOf)
*
- * @throws SolrServerException
+ * @throws DocumentStoreException
* @throws MalformedURLException
*/
- private synchronized void updateDocumentHierarchy(ResourceStructureGraph resourceStructureGraph) throws DocumentStoreException, MalformedURLException, IOException {
+ private synchronized void updateDocumentHierarchy(ResourceStructureGraph resourceStructureGraph) throws DocumentStoreException, IOException {
LOG.info(resourceStructureGraph.printStatistics(0));
final AtomicInteger updateCount = new AtomicInteger();
final Iterator vertexIter = resourceStructureGraph.getFoundVertices().iterator();
diff --git a/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MorgueIndexer.java b/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MorgueIndexer.java
index 0f095d3aa..4b3a34875 100644
--- a/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MorgueIndexer.java
+++ b/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MorgueIndexer.java
@@ -30,6 +30,7 @@
import java.util.stream.Collectors;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpJdkSolrClient;
import org.apache.solr.client.solrj.request.QueryRequest;
@@ -287,7 +288,7 @@ private List idsPresentInLiveIndex(List ids, String idField) thr
liveItemsQuery.setFields(idField);
liveItemsQuery.setRows(ids.size());
- final QueryRequest queryRequest = new QueryRequest(liveItemsQuery);
+ final QueryRequest queryRequest = new QueryRequest(liveItemsQuery, SolrRequest.METHOD.POST);
// read the live index through the 'fast' handler, which does not collapse results
queryRequest.setPath(FacetConstants.SOLR_REQUEST_HANDLER_FAST);
queryRequest.setBasicAuthCredentials(config.getSolrUserReadOnly(), config.getSolrUserReadOnlyPass());
diff --git a/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AutoCompleteServiceImpl.java b/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AutoCompleteServiceImpl.java
index 3d53248a3..c969f74e7 100644
--- a/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AutoCompleteServiceImpl.java
+++ b/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AutoCompleteServiceImpl.java
@@ -13,6 +13,8 @@
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.common.util.NamedList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* DAO that delivers suggestions for incomplete terms (autocomplete function)
@@ -22,6 +24,8 @@
*/
public class AutoCompleteServiceImpl extends SolrDaoImpl implements AutoCompleteService {
+ private final static Logger logger = LoggerFactory.getLogger(AutoCompleteServiceImpl.class);
+
private static final int MAX_SUGGESTIONS = 10;
public AutoCompleteServiceImpl(SolrClient solrClient, VloConfig config, FieldNameService fieldNameService) {
@@ -37,9 +41,13 @@ public Iterator getChoices(String input) {
query.setQuery(input.toLowerCase());
final QueryRequest req = new QueryRequest(query);
req.setPath("/suggest");
- // fireRawQuery bypasses QueryResponse which crashes on the "suggest" key
- // with solrj 9 + Solr 8 (LinkedHashMap vs NamedList cast)
- return parseSuggestions(fireRawQuery(req));
+ try {
+ return parseSuggestions(fireRawQuery(req));
+ } catch (RuntimeException ex) {
+ logger.warn("Could not get suggestions for '{}': {}", input, ex.toString());
+ logger.debug("Suggestion request failed", ex);
+ return Collections.emptyIterator();
+ }
}
private Iterator parseSuggestions(NamedList