diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 940b8085dc..c23ba73882 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -366,7 +366,12 @@ public class Server { } logger.log(Level.INFO, "Creating new CloudSolrClient"); //NON-NLS - CloudSolrClient client = new CloudSolrClient.Builder(solrUrls).build(); + int connectionTimeoutMs = org.sleuthkit.autopsy.keywordsearch.UserPreferences.getConnectionTimeout(); + CloudSolrClient client = new CloudSolrClient.Builder(solrUrls) + .withConnectionTimeout(connectionTimeoutMs) + .withSocketTimeout(connectionTimeoutMs) + .withResponseParser(new XMLResponseParser()) + .build(); if (!defaultCollectionName.isEmpty()) { client.setDefaultCollection(defaultCollectionName); } @@ -1865,8 +1870,8 @@ public class Server { // We use different Solr clients for different operations. HttpSolrClient is geared towards query performance. // ConcurrentUpdateSolrClient is geared towards batching solr documents for better indexing throughput. // CloudSolrClient is gaered towards SolrCloud deployments. These are only good for collection-specific operations. - private HttpSolrClient queryClient = null; - private SolrClient indexingClient = null; + private HttpSolrClient queryClient; + private SolrClient indexingClient; private final int maxBufferSize; private final List buffer; @@ -1883,8 +1888,8 @@ public class Server { if (caseType == CaseType.SINGLE_USER_CASE) { // get SolrJ client - queryClient = getSolrClient("http://localhost:" + localSolrServerPort + "/solr/" + name); - indexingClient = getConcurrentClient("http://localhost:" + localSolrServerPort + "/solr/" + name); + queryClient = getSolrClient("http://localhost:" + localSolrServerPort + "/solr/" + name); // HttpClient + indexingClient = getConcurrentClient("http://localhost:" + localSolrServerPort + "/solr/" + name); // ConcurrentClient } else { // read Solr connection info from user preferences, unless "solrserver.txt" is present queryClient = configureMultiUserConnection(theCase, index, name); @@ -1892,9 +1897,9 @@ public class Server { // for MU cases, use CloudSolrClient for indexing. Indexing is only supported for Solr 8. if (IndexFinder.getCurrentSolrVersion().equals(index.getSolrVersion())) { IndexingServerProperties properties = getMultiUserServerProperties(theCase.getCaseDirectory()); - indexingClient = getCloudSolrClient(properties.getHost(), properties.getPort(), name); + indexingClient = getCloudSolrClient(properties.getHost(), properties.getPort(), name); // CloudClient } else { - indexingClient = configureMultiUserConnection(theCase, index, name); + indexingClient = configureMultiUserConnection(theCase, index, name); // HttpClient } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/UserPreferences.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/UserPreferences.java index 4110aba789..c685f7e184 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/UserPreferences.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/UserPreferences.java @@ -34,7 +34,7 @@ final class UserPreferences { private static final String INDEXING_DOC_QUEUE_SIZE = "IndexingDocumentQueueSize"; //NON-NLS private static final String INDEXING_NUM_THREADS = "IndexingNumThreads"; //NON-NLS private static final String SOLR_CONNECTION_TIMEOUT_MS = "SolrConnectionTimeoutMs"; //NON-NLS - private static final int DEFAULT_CONNECTION_TIMEOUT_MS = 120000; // 2 minutes + private static final int DEFAULT_CONNECTION_TIMEOUT_MS = 300000; // 5 minutes // Prevent instantiation. private UserPreferences() { @@ -90,7 +90,7 @@ final class UserPreferences { } public static int getDocumentsQueueSize() { - return preferences.getInt(INDEXING_DOC_QUEUE_SIZE, 100); + return preferences.getInt(INDEXING_DOC_QUEUE_SIZE, 30); } public static void setConnectionTimeout(int connectionTimeoutMs) {