Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- updated lucene libraries to 3.6.1 - added lucene-grouping which enables faceted search; try this: http://localhost:8090/solr/select?q=*:*&start=0&rows=3&facet=true&facet.field=host_s

Michael Peter Christene65cecc4199e
diff --git a/.classpath b/.classpath
index 7ea5628c9..4f24aceb9 100644
--- a/.classpath
+++ b/.classpath
@@ -47,13 +47,7 @@
<classpathentry kind="lib" path="lib/guava-r05.jar"/>
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
- <classpathentry kind="lib" path="lib/lucene-core-3.6.0.jar"/>
- <classpathentry kind="lib" path="lib/lucene-phonetic-3.6.0.jar"/>
- <classpathentry kind="lib" path="lib/lucene-spatial-3.6.0.jar"/>
- <classpathentry kind="lib" path="lib/lucene-spellchecker-3.6.0.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
- <classpathentry kind="lib" path="lib/lucene-highlighter-3.6.0.jar"/>
- <classpathentry kind="lib" path="lib/lucene-analyzers-3.6.0.jar"/>
<classpathentry kind="lib" path="lib/servlet-api-2.5-20081211.jar"/>
<classpathentry kind="lib" path="lib/jetty-6.1.26-patched-JETTY-1340.jar"/>
<classpathentry kind="lib" path="lib/jetty-util-6.1.26-patched-JETTY-1340.jar"/>
@@ -62,6 +56,13 @@
<classpathentry kind="lib" path="lib/jempbox-1.7.0.jar"/>
<classpathentry kind="lib" path="lib/apache-solr-core-3.6.1.jar" sourcepath="/Volumes/Raptor/Data/sourcecode/solr-3.6.1/core/src/java"/>
<classpathentry kind="lib" path="lib/apache-solr-solrj-3.6.1.jar" sourcepath="/Volumes/Raptor/Data/sourcecode/solr-3.6.1/core/src/java"/>
+ <classpathentry kind="lib" path="lib/lucene-core-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-analyzers-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-grouping-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-highlighter-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-phonetic-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-spatial-3.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/lucene-spellchecker-3.6.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-core.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
diff --git a/addon/YaCy.app/Contents/Info.plist b/addon/YaCy.app/Contents/Info.plist
index 6bf06f64f..72a6b2a2e 100644
--- a/addon/YaCy.app/Contents/Info.plist
+++ b/addon/YaCy.app/Contents/Info.plist
@@ -73,12 +73,13 @@
<string>$JAVAROOT/lib/json-simple-1.1.jar</string>
<string>$JAVAROOT/lib/log4j-1.2.16.jar</string>
<string>$JAVAROOT/lib/log4j-over-slf4j-1.6.1.jar</string>
- <string>$JAVAROOT/lib/lucene-analyzers-3.6.0.jar</string>
- <string>$JAVAROOT/lib/lucene-core-3.6.0.jar</string>
- <string>$JAVAROOT/lib/lucene-highlighter-3.6.0.jar</string>
- <string>$JAVAROOT/lib/lucene-phonetic-3.6.0.jar</string>
- <string>$JAVAROOT/lib/lucene-spatial-3.6.0.jar</string>
- <string>$JAVAROOT/lib/lucene-spellchecker-3.6.0.jar</string>
+ <string>$JAVAROOT/lib/lucene-analyzers-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-grouping-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-core-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-highlighter-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-phonetic-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-spatial-3.6.1.jar</string>
+ <string>$JAVAROOT/lib/lucene-spellchecker-3.6.1.jar</string>
<string>$JAVAROOT/lib/metadata-extractor-2.4.0-beta-1.jar</string>
<string>$JAVAROOT/lib/mysql-connector-java-5.1.12-bin.jar</string>
<string>$JAVAROOT/lib/pdfbox-1.7.0.jar</string>
diff --git a/build.xml b/build.xml
index 5e3d18b3d..71d78eb61 100644
--- a/build.xml
+++ b/build.xml
@@ -193,12 +193,13 @@
<pathelement location="${lib}/jsoup-1.6.3.jar" />
<pathelement location="${lib}/log4j-1.2.16.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.6.1.jar" />
- <pathelement location="${lib}/lucene-analyzers-3.6.0.jar" />
- <pathelement location="${lib}/lucene-core-3.6.0.jar" />
- <pathelement location="${lib}/lucene-highlighter-3.6.0.jar" />
- <pathelement location="${lib}/lucene-phonetic-3.6.0.jar" />
- <pathelement location="${lib}/lucene-spatial-3.6.0.jar" />
- <pathelement location="${lib}/lucene-spellchecker-3.6.0.jar" />
+ <pathelement location="${lib}/lucene-analyzers-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-grouping-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-core-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-highlighter-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-phonetic-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-spatial-3.6.1.jar" />
+ <pathelement location="${lib}/lucene-spellchecker-3.6.1.jar" />
<pathelement location="${lib}/metadata-extractor-2.4.0-beta-1.jar" />
<pathelement location="${lib}/mysql-connector-java-5.1.12-bin.jar" />
<pathelement location="${lib}/pdfbox-1.7.0.jar" />
diff --git a/lib/lucene-analyzers-3.6.0.jar b/lib/lucene-analyzers-3.6.1.jar
similarity index 92%
rename from lib/lucene-analyzers-3.6.0.jar
rename to lib/lucene-analyzers-3.6.1.jar
index d7e5ccf77..889d9c7bd 100644
Binary files a/lib/lucene-analyzers-3.6.0.jar and b/lib/lucene-analyzers-3.6.1.jar differ
diff --git a/lib/lucene-core-3.6.0.jar b/lib/lucene-core-3.6.1.jar
similarity index 85%
rename from lib/lucene-core-3.6.0.jar
rename to lib/lucene-core-3.6.1.jar
index 5cb8dae5b..5e5753b61 100644
Binary files a/lib/lucene-core-3.6.0.jar and b/lib/lucene-core-3.6.1.jar differ
diff --git a/lib/lucene-grouping-3.6.1.jar b/lib/lucene-grouping-3.6.1.jar
new file mode 100644
index 000000000..316bd7a86
Binary files /dev/null and b/lib/lucene-grouping-3.6.1.jar differ
diff --git a/lib/lucene-highlighter-3.6.0.jar b/lib/lucene-highlighter-3.6.1.jar
similarity index 90%
rename from lib/lucene-highlighter-3.6.0.jar
rename to lib/lucene-highlighter-3.6.1.jar
index f07b95df4..a53fac762 100644
Binary files a/lib/lucene-highlighter-3.6.0.jar and b/lib/lucene-highlighter-3.6.1.jar differ
diff --git a/lib/lucene-phonetic-3.6.0.jar b/lib/lucene-phonetic-3.6.1.jar
similarity index 89%
rename from lib/lucene-phonetic-3.6.0.jar
rename to lib/lucene-phonetic-3.6.1.jar
index c10979b07..3ac6f9f3c 100644
Binary files a/lib/lucene-phonetic-3.6.0.jar and b/lib/lucene-phonetic-3.6.1.jar differ
diff --git a/lib/lucene-spatial-3.6.0.jar b/lib/lucene-spatial-3.6.1.jar
similarity index 89%
rename from lib/lucene-spatial-3.6.0.jar
rename to lib/lucene-spatial-3.6.1.jar
index c94aaad8c..6d4d84abe 100644
Binary files a/lib/lucene-spatial-3.6.0.jar and b/lib/lucene-spatial-3.6.1.jar differ
diff --git a/lib/lucene-spellchecker-3.6.0.jar b/lib/lucene-spellchecker-3.6.1.jar
similarity index 75%
rename from lib/lucene-spellchecker-3.6.0.jar
rename to lib/lucene-spellchecker-3.6.1.jar
index 3cbc48909..b3a176399 100644
Binary files a/lib/lucene-spellchecker-3.6.0.jar and b/lib/lucene-spellchecker-3.6.1.jar differ
diff --git a/source/net/yacy/kelondro/blob/Tables.java b/source/net/yacy/kelondro/blob/Tables.java
index 04130ed58..e17be9060 100644
--- a/source/net/yacy/kelondro/blob/Tables.java
+++ b/source/net/yacy/kelondro/blob/Tables.java
@@ -63,7 +63,7 @@ public class Tables implements Iterable<String> {
public final static String CIDX = "_cidx";
public final static int NOINDEX = 50000;
public final static int RAMINDEX = 100000;
-
+
private static final String suffix = ".bheap";
private static final String system_table_pkcounter = "pkcounter";
private static final String system_table_pkcounter_counterName = "pk";
@@ -95,7 +95,7 @@ public class Tables implements Iterable<String> {
}
this.cidx = new ConcurrentHashMap<String, TablesColumnIndex>();
}
-
+
public TablesColumnIndex getIndex(final String tableName, TablesColumnIndex.INDEXTYPE indexType) throws Exception {
final TablesColumnIndex index;
switch(indexType) {
@@ -104,7 +104,7 @@ public class Tables implements Iterable<String> {
break;
case BLOB:
final String idx_table = tableName+CIDX;
- BEncodedHeap bheap;
+ BEncodedHeap bheap;
bheap = this.getHeap(idx_table);
index = new TablesColumnBLOBIndex(bheap);
break;
@@ -113,13 +113,13 @@ public class Tables implements Iterable<String> {
}
return index;
}
-
+
public TablesColumnIndex getIndex(final String tableName) throws Exception {
// return an existing index
if(this.cidx.containsKey(tableName)) {
return this.cidx.get(tableName);
}
-
+
// create a new index
int size;
try {
@@ -129,15 +129,15 @@ public class Tables implements Iterable<String> {
}
final TablesColumnIndex index;
-
+
if(size < NOINDEX) {
- throw new Exception("TableColumnIndex not available for tables with less than "+NOINDEX+" rows: "+tableName);
- }
+ throw new RuntimeException("TableColumnIndex not available for tables with less than "+NOINDEX+" rows: "+tableName);
+ }
if(size < RAMINDEX) {
index = new TablesColumnRAMIndex();
} else {
final String idx_table = tableName+CIDX;
- BEncodedHeap bheap;
+ BEncodedHeap bheap;
try {
bheap = this.getHeap(idx_table);
} catch (IOException e) {
@@ -146,20 +146,20 @@ public class Tables implements Iterable<String> {
}
if(bheap != null) {
index = new TablesColumnBLOBIndex(bheap);
- } else {
+ } else {
index = new TablesColumnRAMIndex();
- }
+ }
}
- this.cidx.put(tableName, index);
+ this.cidx.put(tableName, index);
return index;
}
-
+
public boolean hasIndex (final String tableName) {
return this.cidx.contains(tableName);
}
-
+
public boolean hasIndex (final String tableName, final String columnName) {
- if(this.cidx.containsKey(tableName)) {
+ if(this.cidx.containsKey(tableName)) {
return this.cidx.get(tableName).hasIndex(columnName);
}
try {
@@ -168,22 +168,22 @@ public class Tables implements Iterable<String> {
}
} catch (IOException e) {
Log.logException(e);
- }
+ }
return false;
}
- public Iterator<Row> getByIndex(final String table, final String whereColumn, final String separator, final String whereValue) {
+ public Iterator<Row> getByIndex(final String table, final String whereColumn, final String separator, final String whereValue) {
final HashSet<Tables.Row> rows = new HashSet<Tables.Row>();
final TreeSet<byte[]> set1 = new TreeSet<byte[]>(TablesColumnIndex.NATURALORDER);
final TreeSet<byte[]> set2 = new TreeSet<byte[]>(TablesColumnIndex.NATURALORDER);
final String[] values = whereValue.split(separator);
if(this.hasIndex(table, whereColumn)) {
- try {
+ try {
final TablesColumnIndex index = this.getIndex(table);
for(int i=0; i<values.length; i++) {
if(index.containsKey(whereColumn, values[i])) {
final Iterator<byte[]> biter = index.get(whereColumn, values[i]).iterator();
- while(biter.hasNext()) {
+ while(biter.hasNext()) {
set1.add(biter.next());
}
if(i==0) {
@@ -192,12 +192,12 @@ public class Tables implements Iterable<String> {
set2.retainAll(set1);
}
set1.clear();
- }
+ }
}
for(byte[] pk : set2) {
rows.add(this.select(table, pk));
}
-
+
} catch (Exception e) {
Log.logException(e);
return new HashSet<Row>().iterator();
@@ -214,10 +214,10 @@ public class Tables implements Iterable<String> {
patternBuilder.append(p3);
patternBuilder.append(values.length);
patternBuilder.append('}');
- final Pattern p = Pattern.compile(patternBuilder.toString(), Pattern.CASE_INSENSITIVE);
+ final Pattern p = Pattern.compile(patternBuilder.toString(), Pattern.CASE_INSENSITIVE);
try {
return this.iterator(table, whereColumn, p);
- } catch (IOException e) {
+ } catch (IOException e) {
Log.logException(e);
return new HashSet<Row>().iterator();
}