diff --git a/ivy.xml b/ivy.xml
index ab72a81d1..0c97e4149 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -41,24 +41,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.java
index 75a399557..e9e89bd01 100644
--- a/source/net/yacy/search/index/Fulltext.java
+++ b/source/net/yacy/search/index/Fulltext.java
@@ -51,7 +51,6 @@ import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrConfig;
-import org.apache.solr.schema.IndexSchema;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.date.ISO8601Formatter;
@@ -90,7 +89,7 @@ import net.yacy.search.schema.WebgraphSchema;
public final class Fulltext {
private static final String SOLR_PATH = "solr_8_8_1"; // the number should be identical to the number in the property luceneMatchVersion in solrconfig.xml
-// private static final String SOLR_OLD_PATH[] = new String[]{"solr_36", "solr_40", "solr_44", "solr_45", "solr_46", "solr_47", "solr_4_9", "solr_4_10", "solr_5_2", "solr_5_5", "solr_6_6"};
+ // private static final String SOLR_OLD_PATH[] = new String[]{"solr_36", "solr_40", "solr_44", "solr_45", "solr_46", "solr_47", "solr_4_9", "solr_4_10", "solr_5_2", "solr_5_5", "solr_6_6"};
// class objects
private final File segmentPath;
@@ -99,7 +98,7 @@ public final class Fulltext {
private InstanceMirror solrInstances;
/** Synchronization lock for solrInstances property */
- private ReentrantLock solrInstancesLock;
+ private final ReentrantLock solrInstancesLock;
private final CollectionConfiguration collectionConfiguration;
private final WebgraphConfiguration webgraphConfiguration;
@@ -138,7 +137,7 @@ public final class Fulltext {
}
public void connectLocalSolr() throws IOException {
- File solrLocation = new File(this.segmentPath, SOLR_PATH);
+ final File solrLocation = new File(this.segmentPath, SOLR_PATH);
// migrate old solr to new
/*
@@ -151,13 +150,12 @@ public final class Fulltext {
}
}
}
- */
+ */
- EmbeddedInstance localCollectionInstance = new EmbeddedInstance(new File(new File(Switchboard.getSwitchboard().appPath, "defaults"), "solr"), solrLocation, CollectionSchema.CORE_NAME, new String[]{CollectionSchema.CORE_NAME, WebgraphSchema.CORE_NAME});
- SolrConfig config = localCollectionInstance.getDefaultCore().getSolrConfig();
- String versionValue = config.getVal(IndexSchema.LUCENE_MATCH_VERSION_PARAM, true);
- Version luceneVersion = SolrConfig.parseLuceneVersionString(versionValue);
- String lvn = luceneVersion.major + "_" + luceneVersion.minor + "_" + luceneVersion.bugfix;
+ final EmbeddedInstance localCollectionInstance = new EmbeddedInstance(new File(new File(Switchboard.getSwitchboard().appPath, "defaults"), "solr"), solrLocation, CollectionSchema.CORE_NAME, new String[]{CollectionSchema.CORE_NAME, WebgraphSchema.CORE_NAME});
+ final SolrConfig config = localCollectionInstance.getDefaultCore().getSolrConfig();
+ final Version luceneVersion = config.luceneMatchVersion;
+ final String lvn = luceneVersion.major + "_" + luceneVersion.minor + "_" + luceneVersion.bugfix;
assert SOLR_PATH.endsWith(lvn) : "luceneVersion = " + lvn + ", solrPath = " + SOLR_PATH + ", check defaults/solr/solrconfig.xml";
ConcurrentLog.info("Fulltext", "using lucene version " + lvn);
@@ -204,7 +202,7 @@ public final class Fulltext {
SwitchboardConstants.REMOTE_SOLR_BINARY_RESPONSE_ENABLED_DEFAULT);
}
return this.solrInstances.getDefaultRemoteConnector(useBinaryResponseWriter);
- } catch (IOException e) {
+ } catch (final IOException e) {
return null;
}
}
@@ -256,9 +254,9 @@ public final class Fulltext {
}
this.solrInstancesLock.lock();
try {
- EmbeddedInstance instance = this.solrInstances.getEmbedded();
+ final EmbeddedInstance instance = this.solrInstances.getEmbedded();
if (instance != null) {
- for (String name: instance.getCoreNames()) {
+ for (final String name: instance.getCoreNames()) {
this.solrInstances.getEmbeddedConnector(name).clear();
}
this.commit(false);
@@ -272,9 +270,9 @@ public final class Fulltext {
public void clearRemoteSolr() throws IOException {
this.solrInstancesLock.lock();
try {
- ShardInstance instance = this.solrInstances.getRemote();
+ final ShardInstance instance = this.solrInstances.getRemote();
if (instance != null) {
- for (String name: instance.getCoreNames()) {
+ for (final String name: instance.getCoreNames()) {
this.solrInstances.getRemoteConnector(name).clear();
}
}
@@ -291,11 +289,11 @@ public final class Fulltext {
private long collectionSizeLastAccess = 0;
private long collectionSizeLastValue = 0;
public long collectionSize() {
- long t = System.currentTimeMillis();
+ final long t = System.currentTimeMillis();
if (t - this.collectionSizeLastAccess < 1000) return this.collectionSizeLastValue;
- SolrConnector sc = getDefaultConnector();
+ final SolrConnector sc = getDefaultConnector();
if (sc == null) return 0;
- long size = sc.getSize();
+ final long size = sc.getSize();
this.collectionSizeLastAccess = t;
this.collectionSizeLastValue = size;
return size;
@@ -311,14 +309,14 @@ public final class Fulltext {
public void close() {
try {
this.solrInstances.close();
- } catch (Throwable e) {
+ } catch (final Throwable e) {
ConcurrentLog.logException(e);
}
}
private long lastCommit = 0;
public void commit(boolean softCommit) {
- long t = System.currentTimeMillis();
+ final long t = System.currentTimeMillis();
if (this.lastCommit + 10000 > t) return;
this.lastCommit = t;
getDefaultConnector().commit(softCommit);
@@ -338,10 +336,10 @@ public final class Fulltext {
*/
public URIMetadataNode getMetadata(final WeakPriorityBlockingQueue.Element element) {
if (element == null) return null;
- WordReferenceVars wre = element.getElement();
+ final WordReferenceVars wre = element.getElement();
if (wre == null) return null; // all time was already wasted in takeRWI to get another element
- long score = element.getWeight();
- URIMetadataNode node = getMetadata(wre.urlhash(), wre, score);
+ final long score = element.getWeight();
+ final URIMetadataNode node = getMetadata(wre.urlhash(), wre, score);
return node;
}
@@ -351,11 +349,11 @@ public final class Fulltext {
}
private URIMetadataNode getMetadata(final byte[] urlHash, final WordReferenceVars wre, final long score) {
- String u = ASCII.String(urlHash);
+ final String u = ASCII.String(urlHash);
// get the metadata from Solr
try {
- SolrDocument doc = this.getDefaultConnector().getDocumentById(u);
+ final SolrDocument doc = this.getDefaultConnector().getDocumentById(u);
if (doc != null) {
return new URIMetadataNode(doc, wre, score);
}
@@ -367,10 +365,10 @@ public final class Fulltext {
}
public void putDocument(final SolrInputDocument doc) throws IOException {
- SolrConnector connector = this.getDefaultConnector();
+ final SolrConnector connector = this.getDefaultConnector();
if (connector == null) return;
- String id = (String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName());
- String url = (String) doc.getFieldValue(CollectionSchema.sku.getSolrFieldName());
+ final String id = (String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName());
+ final String url = (String) doc.getFieldValue(CollectionSchema.sku.getSolrFieldName());
assert url != null && url.length() < 30000;
ConcurrentLog.info("Fulltext", "indexing: " + id + " " + url);
try {
@@ -396,16 +394,16 @@ public final class Fulltext {
* deprecated method to store document metadata, use Solr documents wherever possible
*/
public void putMetadata(final URIMetadataNode entry) throws IOException {
- byte[] idb = entry.hash();
- String id = ASCII.String(idb);
+ final byte[] idb = entry.hash();
+ final String id = ASCII.String(idb);
try {
// because node entries are richer than metadata entries we must check if they exist to prevent that they are overwritten
- SolrDocument doc = this.getDefaultConnector().getDocumentById(id, CollectionSchema.collection_sxt.getSolrFieldName());
+ final SolrDocument doc = this.getDefaultConnector().getDocumentById(id, CollectionSchema.collection_sxt.getSolrFieldName());
if (doc == null || !doc.containsKey(CollectionSchema.collection_sxt.getSolrFieldName())) {
// document does not exist
putDocument(getDefaultConfiguration().metadata2solr(entry));
} else {
- Collection