removed warnings

pull/9/merge
Michael Peter Christen 10 years ago
parent 500cfa9457
commit dbbad23e12

@ -321,7 +321,7 @@ public class Bookmarks {
count = 0; count = 0;
while(count < max_count && it.hasNext()) { while(count < max_count && it.hasNext()) {
Bookmark bookmark = bookmark = sb.bookmarksDB.getBookmark(it.next()); Bookmark bookmark = sb.bookmarksDB.getBookmark(it.next());
if (bookmark != null){ if (bookmark != null){
if (bookmark.getFeed() && isAdmin) { if (bookmark.getFeed() && isAdmin) {

@ -31,7 +31,6 @@ import java.io.IOException;
import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader;
import net.yacy.crawler.data.Cache; import net.yacy.crawler.data.Cache;
import net.yacy.data.WorkTables;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants; import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects; import net.yacy.server.serverObjects;

@ -44,7 +44,7 @@ import net.yacy.cora.util.ByteBuffer;
import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException; import net.yacy.cora.util.SpaceExceededException;
import net.yacy.data.ListManager; import net.yacy.data.ListManager;
import net.yacy.document.Condenser; import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode; import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference; import net.yacy.kelondro.data.word.WordReference;
@ -526,11 +526,11 @@ public class IndexControlRWIs_p {
prop.putNum("genUrlList_urlList_" + i + "_urlExists_urllength", entry.word().urllength()); prop.putNum("genUrlList_urlList_" + i + "_urlExists_urllength", entry.word().urllength());
prop.put( prop.put(
"genUrlList_urlList_" + i + "_urlExists_props", "genUrlList_urlList_" + i + "_urlExists_props",
((entry.word().flags().get(Condenser.flag_cat_indexof)) ? "appears on index page, " : "") ((entry.word().flags().get(Tokenizer.flag_cat_indexof)) ? "appears on index page, " : "")
+ ((entry.word().flags().get(Condenser.flag_cat_hasimage)) ? "contains images, " : "") + ((entry.word().flags().get(Tokenizer.flag_cat_hasimage)) ? "contains images, " : "")
+ ((entry.word().flags().get(Condenser.flag_cat_hasaudio)) ? "contains audio, " : "") + ((entry.word().flags().get(Tokenizer.flag_cat_hasaudio)) ? "contains audio, " : "")
+ ((entry.word().flags().get(Condenser.flag_cat_hasvideo)) ? "contains video, " : "") + ((entry.word().flags().get(Tokenizer.flag_cat_hasvideo)) ? "contains video, " : "")
+ ((entry.word().flags().get(Condenser.flag_cat_hasapp)) ? "contains applications, " : "") + ((entry.word().flags().get(Tokenizer.flag_cat_hasapp)) ? "contains applications, " : "")
+ ((entry.word().flags().get(WordReferenceRow.flag_app_dc_identifier)) ? "appears in url, " : "") + ((entry.word().flags().get(WordReferenceRow.flag_app_dc_identifier)) ? "appears in url, " : "")
+ ((entry.word().flags().get(WordReferenceRow.flag_app_dc_title)) ? "appears in title, " : "") + ((entry.word().flags().get(WordReferenceRow.flag_app_dc_title)) ? "appears in title, " : "")
+ ((entry.word().flags().get(WordReferenceRow.flag_app_dc_creator)) ? "appears in author, " : "") + ((entry.word().flags().get(WordReferenceRow.flag_app_dc_creator)) ? "appears in author, " : "")
@ -590,19 +590,19 @@ public class IndexControlRWIs_p {
b.set(WordReferenceRow.flag_app_emphasized, true); b.set(WordReferenceRow.flag_app_emphasized, true);
} }
if ( post.get("image", "").equals("on") ) { if ( post.get("image", "").equals("on") ) {
b.set(Condenser.flag_cat_hasimage, true); b.set(Tokenizer.flag_cat_hasimage, true);
} }
if ( post.get("audio", "").equals("on") ) { if ( post.get("audio", "").equals("on") ) {
b.set(Condenser.flag_cat_hasaudio, true); b.set(Tokenizer.flag_cat_hasaudio, true);
} }
if ( post.get("video", "").equals("on") ) { if ( post.get("video", "").equals("on") ) {
b.set(Condenser.flag_cat_hasvideo, true); b.set(Tokenizer.flag_cat_hasvideo, true);
} }
if ( post.get("app", "").equals("on") ) { if ( post.get("app", "").equals("on") ) {
b.set(Condenser.flag_cat_hasapp, true); b.set(Tokenizer.flag_cat_hasapp, true);
} }
if ( post.get("indexof", "").equals("on") ) { if ( post.get("indexof", "").equals("on") ) {
b.set(Condenser.flag_cat_indexof, true); b.set(Tokenizer.flag_cat_indexof, true);
} }
return b; return b;
} }
@ -678,11 +678,11 @@ public class IndexControlRWIs_p {
prop.put("searchresult_subject", theSearch.flagCount()[WordReferenceRow.flag_app_dc_subject]); prop.put("searchresult_subject", theSearch.flagCount()[WordReferenceRow.flag_app_dc_subject]);
prop.put("searchresult_url", theSearch.flagCount()[WordReferenceRow.flag_app_dc_identifier]); prop.put("searchresult_url", theSearch.flagCount()[WordReferenceRow.flag_app_dc_identifier]);
prop.put("searchresult_emphasized", theSearch.flagCount()[WordReferenceRow.flag_app_emphasized]); prop.put("searchresult_emphasized", theSearch.flagCount()[WordReferenceRow.flag_app_emphasized]);
prop.put("searchresult_image", theSearch.flagCount()[Condenser.flag_cat_hasimage]); prop.put("searchresult_image", theSearch.flagCount()[Tokenizer.flag_cat_hasimage]);
prop.put("searchresult_audio", theSearch.flagCount()[Condenser.flag_cat_hasaudio]); prop.put("searchresult_audio", theSearch.flagCount()[Tokenizer.flag_cat_hasaudio]);
prop.put("searchresult_video", theSearch.flagCount()[Condenser.flag_cat_hasvideo]); prop.put("searchresult_video", theSearch.flagCount()[Tokenizer.flag_cat_hasvideo]);
prop.put("searchresult_app", theSearch.flagCount()[Condenser.flag_cat_hasapp]); prop.put("searchresult_app", theSearch.flagCount()[Tokenizer.flag_cat_hasapp]);
prop.put("searchresult_indexof", theSearch.flagCount()[Condenser.flag_cat_indexof]); prop.put("searchresult_indexof", theSearch.flagCount()[Tokenizer.flag_cat_indexof]);
} }
return theSearch; return theSearch;
} }

@ -46,11 +46,11 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.CommonPattern; import net.yacy.cora.util.CommonPattern;
import net.yacy.crawler.data.Cache; import net.yacy.crawler.data.Cache;
import net.yacy.crawler.retrieval.Response; import net.yacy.crawler.retrieval.Response;
import net.yacy.document.Condenser;
import net.yacy.document.Document; import net.yacy.document.Document;
import net.yacy.document.LibraryProvider; import net.yacy.document.LibraryProvider;
import net.yacy.document.Parser; import net.yacy.document.Parser;
import net.yacy.document.SentenceReader; import net.yacy.document.SentenceReader;
import net.yacy.document.Tokenizer;
import net.yacy.document.WordTokenizer; import net.yacy.document.WordTokenizer;
import net.yacy.document.parser.html.CharacterCoding; import net.yacy.document.parser.html.CharacterCoding;
import net.yacy.document.parser.html.ImageEntry; import net.yacy.document.parser.html.ImageEntry;
@ -158,7 +158,7 @@ public class ViewFile {
descr = urlEntry.dc_title(); descr = urlEntry.dc_title();
//urlEntry.wordCount(); //urlEntry.wordCount();
size = urlEntry.filesize(); size = urlEntry.filesize();
pre = urlEntry.flags().get(Condenser.flag_cat_indexof); pre = urlEntry.flags().get(Tokenizer.flag_cat_indexof);
prop.put("moar", 1); prop.put("moar", 1);
prop.putHTML("moar_search", post.get("search","")); prop.putHTML("moar_search", post.get("search",""));
} }

@ -59,10 +59,10 @@ import net.yacy.data.BookmarksDB.Bookmark;
import net.yacy.data.DidYouMean; import net.yacy.data.DidYouMean;
import net.yacy.data.UserDB; import net.yacy.data.UserDB;
import net.yacy.data.ymark.YMarkTables; import net.yacy.data.ymark.YMarkTables;
import net.yacy.document.Condenser;
import net.yacy.document.Document; import net.yacy.document.Document;
import net.yacy.document.LibraryProvider; import net.yacy.document.LibraryProvider;
import net.yacy.document.Parser; import net.yacy.document.Parser;
import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode; import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.util.Bitfield; import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.Formatter; import net.yacy.kelondro.util.Formatter;
@ -242,7 +242,7 @@ public class yacysearch {
: null; : null;
if ( indexof ) { if ( indexof ) {
constraint = new Bitfield(4); constraint = new Bitfield(4);
constraint.set(Condenser.flag_cat_indexof, true); constraint.set(Tokenizer.flag_cat_indexof, true);
} }
// SEARCH // SEARCH
@ -396,7 +396,7 @@ public class yacysearch {
if ( constraint == null ) { if ( constraint == null ) {
constraint = new Bitfield(4); constraint = new Bitfield(4);
} }
constraint.set(Condenser.flag_cat_haslocation, true); constraint.set(Tokenizer.flag_cat_haslocation, true);
modifier.add("/location"); modifier.add("/location");
} }

@ -56,7 +56,7 @@ public class yacysearchtrailer {
private static final int TOPWORDS_MINSIZE = 8; private static final int TOPWORDS_MINSIZE = 8;
private static final int TOPWORDS_MAXSIZE = 22; private static final int TOPWORDS_MAXSIZE = 22;
@SuppressWarnings({ "deprecation", "static-access" }) @SuppressWarnings({ })
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects(); final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env; final Switchboard sb = (Switchboard) env;

@ -21,7 +21,6 @@
package net.yacy.cora.federate.solr.instance; package net.yacy.cora.federate.solr.instance;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;

@ -258,7 +258,6 @@ public class EnhancedXMLResponseWriter implements QueryResponseWriter {
writer.write(lb); writer.write(lb);
} }
@SuppressWarnings({ "static-access", "deprecation" })
private static void writeField(final Writer writer, final String typeName, final String name, final String value) throws IOException { private static void writeField(final Writer writer, final String typeName, final String name, final String value) throws IOException {
if (typeName.equals(SolrType.text_general.printName()) || if (typeName.equals(SolrType.text_general.printName()) ||
typeName.equals(SolrType.string.printName()) || typeName.equals(SolrType.string.printName()) ||
@ -279,7 +278,6 @@ public class EnhancedXMLResponseWriter implements QueryResponseWriter {
} }
} }
@SuppressWarnings({ "static-access", "deprecation" })
private static void writeField(final Writer writer, final String name, final Object value) throws IOException { private static void writeField(final Writer writer, final String name, final Object value) throws IOException {
if (value instanceof String) { if (value instanceof String) {
writeTag(writer, "str", name, (String) value, true); writeTag(writer, "str", name, (String) value, true);

@ -218,7 +218,6 @@ public class HTMLResponseWriter implements QueryResponseWriter {
return kv; return kv;
} }
@SuppressWarnings({ "static-access", "deprecation" })
private static String field2string(final FieldType type, final String value) { private static String field2string(final FieldType type, final String value) {
String typeName = type.getTypeName(); String typeName = type.getTypeName();
if (typeName.equals(SolrType.bool.printName())) { if (typeName.equals(SolrType.bool.printName())) {

@ -21,7 +21,6 @@
package net.yacy.crawler; package net.yacy.crawler;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

@ -148,9 +148,8 @@ public class RecrawlBusyThread extends AbstractBusyThread {
if (this.urlstack.isEmpty()) { if (this.urlstack.isEmpty()) {
return processSingleQuery(); return processSingleQuery();
} else {
return feedToCrawler();
} }
return feedToCrawler();
} }

@ -172,9 +172,8 @@ public class BookmarksDB {
if (map == null) { if (map == null) {
ConcurrentLog.info("BOOKMARKS", "cannot get bookmark for url hash " + urlHash); ConcurrentLog.info("BOOKMARKS", "cannot get bookmark for url hash " + urlHash);
return null; return null;
} else {
return new Bookmark(map);
} }
return new Bookmark(map);
} catch (final Throwable e) { } catch (final Throwable e) {
return null; return null;
} }

@ -339,7 +339,7 @@ public class WorkTables extends Tables {
row.put(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, new Date(d)); row.put(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, new Date(d));
} }
public void failURLsRegisterMissingWord(IndexCell<WordReference> indexCell, final DigestURL url, HandleSet queryHashes, final String reason) { public void failURLsRegisterMissingWord(IndexCell<WordReference> indexCell, final DigestURL url, HandleSet queryHashes) {
// remove words from index // remove words from index
if (indexCell != null) { if (indexCell != null) {

@ -46,8 +46,8 @@ import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.Base64Order; import net.yacy.cora.order.Base64Order;
import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response; import net.yacy.crawler.retrieval.Response;
import net.yacy.document.Condenser;
import net.yacy.document.SentenceReader; import net.yacy.document.SentenceReader;
import net.yacy.document.Tokenizer;
import net.yacy.document.parser.pdfParser; import net.yacy.document.parser.pdfParser;
import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReferenceRow; import net.yacy.kelondro.data.word.WordReferenceRow;
@ -389,14 +389,14 @@ public class URIMetadataNode extends SolrDocument /* implements Comparable<URIMe
public Bitfield flags() { public Bitfield flags() {
if (flags == null) { if (flags == null) {
this.flags = new Bitfield(); this.flags = new Bitfield();
if (dc_subject() != null && dc_subject().indexOf("indexof") >= 0) this.flags.set(Condenser.flag_cat_indexof, true); if (dc_subject() != null && dc_subject().indexOf("indexof") >= 0) this.flags.set(Tokenizer.flag_cat_indexof, true);
ContentDomain cd = getContentDomain(); ContentDomain cd = getContentDomain();
if (lon() != 0.0d || lat() != 0.0d) this.flags.set(Condenser.flag_cat_haslocation, true); if (lon() != 0.0d || lat() != 0.0d) this.flags.set(Tokenizer.flag_cat_haslocation, true);
if (cd == ContentDomain.IMAGE || limage() > 0) this.flags.set(Condenser.flag_cat_hasimage, true); if (cd == ContentDomain.IMAGE || limage() > 0) this.flags.set(Tokenizer.flag_cat_hasimage, true);
if (cd == ContentDomain.AUDIO || laudio() > 0) this.flags.set(Condenser.flag_cat_hasaudio, true); if (cd == ContentDomain.AUDIO || laudio() > 0) this.flags.set(Tokenizer.flag_cat_hasaudio, true);
if (cd == ContentDomain.VIDEO || lvideo() > 0) this.flags.set(Condenser.flag_cat_hasvideo, true); if (cd == ContentDomain.VIDEO || lvideo() > 0) this.flags.set(Tokenizer.flag_cat_hasvideo, true);
if (cd == ContentDomain.APP) this.flags.set(Condenser.flag_cat_hasapp, true); if (cd == ContentDomain.APP) this.flags.set(Tokenizer.flag_cat_hasapp, true);
if (lapp() > 0) this.flags.set(Condenser.flag_cat_hasapp, true); if (lapp() > 0) this.flags.set(Tokenizer.flag_cat_hasapp, true);
} }
return this.flags; return this.flags;
} }
@ -707,7 +707,7 @@ public class URIMetadataNode extends SolrDocument /* implements Comparable<URIMe
// seed is not known from here // seed is not known from here
try { try {
if (indexSegment.termIndex() != null) indexSegment.termIndex().remove( if (indexSegment.termIndex() != null) indexSegment.termIndex().remove(
Word.words2hashesHandles(Condenser.getWords( Word.words2hashesHandles(Tokenizer.getWords(
("yacyshare " + ("yacyshare " +
path.replace('?', ' ') + path.replace('?', ' ') +
" " + " " +

@ -88,41 +88,6 @@ public final class OS {
if (isWindows) maxPathLength = 255; else maxPathLength = 65535; if (isWindows) maxPathLength = 255; else maxPathLength = 65535;
} }
/**
* finds the maximum possible heap (may cause high system load)
* @return heap in -Xmx<i>[heap]</i>m
* @author [DW], 07.02.2009
*/
private static int getWin32MaxHeap() {
int maxmem = 1000;
while(checkWin32Heap(maxmem)) maxmem += 100;
while(!checkWin32Heap(maxmem)) maxmem -= 10;
return maxmem;
}
private final static ConcurrentLog memchecklog = new ConcurrentLog("MEMCHECK");
/**
* checks heap (may cause high system load)
* @param mem heap to check in -Xmx<i>[heap]</i>m
* @return true if possible
* @author [DW], 07.02.2009
*/
private static boolean checkWin32Heap(final int mem){
String line = "";
final List<String> processArgs = new ArrayList<String>();
processArgs.add("java");
processArgs.add("-Xms4m");
processArgs.add("-Xmx" + Integer.toString(mem) + "m");
try {
line = ConsoleInterface.getLastLineConsoleOutput(processArgs, memchecklog);
} catch (final IOException e) {
return false;
}
return (line.indexOf("space for object heap",0) > -1) ? false : true;
}
public static String infoString() { public static String infoString() {
String s = "System="; String s = "System=";
if (systemOS == System.Unknown) s += "unknown"; if (systemOS == System.Unknown) s += "unknown";

@ -47,9 +47,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;

@ -355,7 +355,6 @@ public class QueryModifier {
Date onDate = DateDetection.parseLine(onDescription, timezoneOffset); Date onDate = DateDetection.parseLine(onDescription, timezoneOffset);
StringBuilder filterQuery = new StringBuilder(20); StringBuilder filterQuery = new StringBuilder(20);
if (onDate != null) { if (onDate != null) {
@SuppressWarnings({ "deprecation", "static-access" })
String dstr = TrieDateField.formatExternal(onDate); String dstr = TrieDateField.formatExternal(onDate);
filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstr).append(" TO ").append(dstr).append(']'); filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstr).append(" TO ").append(dstr).append(']');
} }
@ -367,9 +366,7 @@ public class QueryModifier {
Date toDate = to == null || to.equals("*") ? null : DateDetection.parseLine(to, timezoneOffset); Date toDate = to == null || to.equals("*") ? null : DateDetection.parseLine(to, timezoneOffset);
StringBuilder filterQuery = new StringBuilder(20); StringBuilder filterQuery = new StringBuilder(20);
if (fromDate != null && toDate != null) { if (fromDate != null && toDate != null) {
@SuppressWarnings({ "deprecation", "static-access" })
String dstrFrom = fromDate == null ? "*" : TrieDateField.formatExternal(fromDate); String dstrFrom = fromDate == null ? "*" : TrieDateField.formatExternal(fromDate);
@SuppressWarnings({ "deprecation", "static-access" })
String dstrTo = toDate == null ? "*" : TrieDateField.formatExternal(toDate); String dstrTo = toDate == null ? "*" : TrieDateField.formatExternal(toDate);
filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstrFrom).append(" TO ").append(dstrTo).append(']'); filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstrFrom).append(" TO ").append(dstrTo).append(']');
} }

@ -53,8 +53,8 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.HandleSet; import net.yacy.cora.storage.HandleSet;
import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException; import net.yacy.cora.util.SpaceExceededException;
import net.yacy.document.Condenser;
import net.yacy.document.LibraryProvider; import net.yacy.document.LibraryProvider;
import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReferenceRow; import net.yacy.kelondro.data.word.WordReferenceRow;
import net.yacy.kelondro.index.RowHandleSet; import net.yacy.kelondro.index.RowHandleSet;
@ -349,7 +349,7 @@ public final class QueryParams {
*/ */
private final boolean matchesText(final String text) { private final boolean matchesText(final String text) {
boolean ret = false; boolean ret = false;
QueryGoal.NormalizedWords words = new QueryGoal.NormalizedWords(Condenser.getWords(text, null).keySet()); QueryGoal.NormalizedWords words = new QueryGoal.NormalizedWords(Tokenizer.getWords(text, null).keySet());
if (!SetTools.anymatchByTest(this.queryGoal.getExcludeWords(), words)) { if (!SetTools.anymatchByTest(this.queryGoal.getExcludeWords(), words)) {
ret = SetTools.totalInclusion(this.queryGoal.getIncludeWords(), words); ret = SetTools.totalInclusion(this.queryGoal.getIncludeWords(), words);
} }
@ -358,7 +358,7 @@ public final class QueryParams {
protected static final boolean anymatch(final String text, final Iterator<String> keywords) { protected static final boolean anymatch(final String text, final Iterator<String> keywords) {
if (keywords == null || !keywords.hasNext()) return false; if (keywords == null || !keywords.hasNext()) return false;
final SortedSet<String> textwords = (SortedSet<String>) Condenser.getWords(text, null).keySet(); final SortedSet<String> textwords = (SortedSet<String>) Tokenizer.getWords(text, null).keySet();
return SetTools.anymatchByTest(keywords, textwords); return SetTools.anymatchByTest(keywords, textwords);
} }
@ -448,10 +448,8 @@ public final class QueryParams {
// add site facets // add site facets
fqs.addAll(getFacetsFilterQueries()); fqs.addAll(getFacetsFilterQueries());
if (fqs.size() > 0) { if (fqs.size() > 0) {
for (String f: fqs) {
params.setFilterQueries(fqs.toArray(new String[fqs.size()])); params.setFilterQueries(fqs.toArray(new String[fqs.size()]));
} }
}
// set facet query attributes // set facet query attributes
if (getFacets && this.facetfields.size() > 0) { if (getFacets && this.facetfields.size() > 0) {
@ -463,9 +461,7 @@ public final class QueryParams {
for (String field: this.facetfields) params.addFacetField("{!ex=" + field + "}" + field); // params.addFacetField("{!ex=" + field + "}" + field); for (String field: this.facetfields) params.addFacetField("{!ex=" + field + "}" + field); // params.addFacetField("{!ex=" + field + "}" + field);
if (this.facetfields.contains(CollectionSchema.dates_in_content_dts.name())) { if (this.facetfields.contains(CollectionSchema.dates_in_content_dts.name())) {
params.setParam("facet.range", CollectionSchema.dates_in_content_dts.name()); params.setParam("facet.range", CollectionSchema.dates_in_content_dts.name());
@SuppressWarnings({ "static-access", "deprecation" })
String start = TrieDateField.formatExternal(new Date(System.currentTimeMillis() - 1000L * 60L * 60L * 24L * 3)); String start = TrieDateField.formatExternal(new Date(System.currentTimeMillis() - 1000L * 60L * 60L * 24L * 3));
@SuppressWarnings({ "static-access", "deprecation" })
String end = TrieDateField.formatExternal(new Date(System.currentTimeMillis() + 1000L * 60L * 60L * 24L * 3)); String end = TrieDateField.formatExternal(new Date(System.currentTimeMillis() + 1000L * 60L * 60L * 24L * 3));
params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.start", start); params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.start", start);
params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.end", end); params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.end", end);

@ -70,10 +70,10 @@ import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.SpaceExceededException; import net.yacy.cora.util.SpaceExceededException;
import net.yacy.crawler.retrieval.Response; import net.yacy.crawler.retrieval.Response;
import net.yacy.data.WorkTables; import net.yacy.data.WorkTables;
import net.yacy.document.Condenser;
import net.yacy.document.LargeNumberCache; import net.yacy.document.LargeNumberCache;
import net.yacy.document.LibraryProvider; import net.yacy.document.LibraryProvider;
import net.yacy.document.TextParser; import net.yacy.document.TextParser;
import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode; import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.data.word.WordReference; import net.yacy.kelondro.data.word.WordReference;
@ -601,10 +601,10 @@ public final class SearchEvent {
// check document domain // check document domain
if (this.query.contentdom.getCode() > 0 && if (this.query.contentdom.getCode() > 0 &&
((this.query.contentdom == ContentDomain.AUDIO && !(flags.get(Condenser.flag_cat_hasaudio))) || ((this.query.contentdom == ContentDomain.AUDIO && !(flags.get(Tokenizer.flag_cat_hasaudio))) ||
(this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Condenser.flag_cat_hasvideo))) || (this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Tokenizer.flag_cat_hasvideo))) ||
(this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Condenser.flag_cat_hasimage))) || (this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Tokenizer.flag_cat_hasimage))) ||
(this.query.contentdom == ContentDomain.APP && !(flags.get(Condenser.flag_cat_hasapp))))) { (this.query.contentdom == ContentDomain.APP && !(flags.get(Tokenizer.flag_cat_hasapp))))) {
if (log.isFine()) log.fine("dropped RWI: contentdom fail"); if (log.isFine()) log.fine("dropped RWI: contentdom fail");
continue pollloop; continue pollloop;
} }
@ -926,10 +926,10 @@ public final class SearchEvent {
// check document domain // check document domain
if (this.query.contentdom.getCode() > 0 && if (this.query.contentdom.getCode() > 0 &&
((this.query.contentdom == ContentDomain.AUDIO && !(flags.get(Condenser.flag_cat_hasaudio))) || ((this.query.contentdom == ContentDomain.AUDIO && !(flags.get(Tokenizer.flag_cat_hasaudio))) ||
(this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Condenser.flag_cat_hasvideo))) || (this.query.contentdom == ContentDomain.VIDEO && !(flags.get(Tokenizer.flag_cat_hasvideo))) ||
(this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Condenser.flag_cat_hasimage))) || (this.query.contentdom == ContentDomain.IMAGE && !(flags.get(Tokenizer.flag_cat_hasimage))) ||
(this.query.contentdom == ContentDomain.APP && !(flags.get(Condenser.flag_cat_hasapp))))) { (this.query.contentdom == ContentDomain.APP && !(flags.get(Tokenizer.flag_cat_hasapp))))) {
if (log.isFine()) log.fine("dropped Node: content domain does not match"); if (log.isFine()) log.fine("dropped Node: content domain does not match");
continue pollloop; continue pollloop;
} }
@ -1201,7 +1201,7 @@ public final class SearchEvent {
} }
// check index-of constraint // check index-of constraint
if ((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_indexof)) && (!(pagetitle.startsWith("index of")))) { if ((this.query.constraint != null) && (this.query.constraint.get(Tokenizer.flag_cat_indexof)) && (!(pagetitle.startsWith("index of")))) {
final Iterator<byte[]> wi = this.query.getQueryGoal().getIncludeHashes().iterator(); final Iterator<byte[]> wi = this.query.getQueryGoal().getIncludeHashes().iterator();
if (this.query.getSegment().termIndex() != null) { if (this.query.getSegment().termIndex() != null) {
while (wi.hasNext()) { while (wi.hasNext()) {
@ -1214,7 +1214,7 @@ public final class SearchEvent {
} }
// check location constraint // check location constraint
if ((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_haslocation)) && (page.lat() == 0.0 || page.lon() == 0.0)) { if ((this.query.constraint != null) && (this.query.constraint.get(Tokenizer.flag_cat_haslocation)) && (page.lat() == 0.0 || page.lon() == 0.0)) {
if (log.isFine()) log.fine("dropped RWI: location constraint"); if (log.isFine()) log.fine("dropped RWI: location constraint");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet(); if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue; continue;
@ -1443,7 +1443,7 @@ public final class SearchEvent {
page, page,
this.snippetFetchWordHashes, this.snippetFetchWordHashes,
null, null,
((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_indexof))), ((this.query.constraint != null) && (this.query.constraint.get(Tokenizer.flag_cat_indexof))),
SearchEvent.SNIPPET_MAX_LENGTH, SearchEvent.SNIPPET_MAX_LENGTH,
!this.query.isLocal()); !this.query.isLocal());
return page.makeResultEntry(this.query.getSegment(), this.peers, snippet); // result without snippet return page.makeResultEntry(this.query.getSegment(), this.peers, snippet); // result without snippet
@ -1459,7 +1459,7 @@ public final class SearchEvent {
page, page,
this.snippetFetchWordHashes, this.snippetFetchWordHashes,
cacheStrategy, cacheStrategy,
((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_indexof))), ((this.query.constraint != null) && (this.query.constraint.get(Tokenizer.flag_cat_indexof))),
180, 180,
!this.query.isLocal()); !this.query.isLocal());
SearchEvent.log.info("text snippet load time for " + page.url().toNormalform(true) + ": " + (System.currentTimeMillis() - startTime) + " ms, " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")"))); SearchEvent.log.info("text snippet load time for " + page.url().toNormalform(true) + ": " + (System.currentTimeMillis() - startTime) + " ms, " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")")));
@ -1479,7 +1479,7 @@ public final class SearchEvent {
} }
final String reason = "no text snippet; errorCode = " + snippet.getErrorCode(); final String reason = "no text snippet; errorCode = " + snippet.getErrorCode();
if (this.deleteIfSnippetFail) { if (this.deleteIfSnippetFail) {
this.workTables.failURLsRegisterMissingWord(this.query.getSegment().termIndex(), page.url(), this.query.getQueryGoal().getIncludeHashes(), reason); this.workTables.failURLsRegisterMissingWord(this.query.getSegment().termIndex(), page.url(), this.query.getQueryGoal().getIncludeHashes());
} }
SearchEvent.log.info("sorted out url " + page.url().toNormalform(true) + " during search: " + reason); SearchEvent.log.info("sorted out url " + page.url().toNormalform(true) + " during search: " + reason);
return null; return null;

@ -38,8 +38,8 @@ import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.sorting.ConcurrentScoreMap; import net.yacy.cora.sorting.ConcurrentScoreMap;
import net.yacy.cora.util.ByteBuffer; import net.yacy.cora.util.ByteBuffer;
import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.Condenser;
import net.yacy.document.LargeNumberCache; import net.yacy.document.LargeNumberCache;
import net.yacy.document.Tokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode; import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.WordReference; import net.yacy.kelondro.data.word.WordReference;
import net.yacy.kelondro.data.word.WordReferenceRow; import net.yacy.kelondro.data.word.WordReferenceRow;
@ -253,11 +253,11 @@ public class ReferenceOrder {
+ ((flags.get(WordReferenceRow.flag_app_dc_subject)) ? 255 << this.ranking.coeff_app_dc_subject : 0) + ((flags.get(WordReferenceRow.flag_app_dc_subject)) ? 255 << this.ranking.coeff_app_dc_subject : 0)
+ ((flags.get(WordReferenceRow.flag_app_dc_description)) ? 255 << this.ranking.coeff_app_dc_description : 0) + ((flags.get(WordReferenceRow.flag_app_dc_description)) ? 255 << this.ranking.coeff_app_dc_description : 0)
+ ((flags.get(WordReferenceRow.flag_app_emphasized)) ? 255 << this.ranking.coeff_appemph : 0) + ((flags.get(WordReferenceRow.flag_app_emphasized)) ? 255 << this.ranking.coeff_appemph : 0)
+ ((flags.get(Condenser.flag_cat_indexof)) ? 255 << this.ranking.coeff_catindexof : 0) + ((flags.get(Tokenizer.flag_cat_indexof)) ? 255 << this.ranking.coeff_catindexof : 0)
+ ((flags.get(Condenser.flag_cat_hasimage)) ? 255 << this.ranking.coeff_cathasimage : 0) + ((flags.get(Tokenizer.flag_cat_hasimage)) ? 255 << this.ranking.coeff_cathasimage : 0)
+ ((flags.get(Condenser.flag_cat_hasaudio)) ? 255 << this.ranking.coeff_cathasaudio : 0) + ((flags.get(Tokenizer.flag_cat_hasaudio)) ? 255 << this.ranking.coeff_cathasaudio : 0)
+ ((flags.get(Condenser.flag_cat_hasvideo)) ? 255 << this.ranking.coeff_cathasvideo : 0) + ((flags.get(Tokenizer.flag_cat_hasvideo)) ? 255 << this.ranking.coeff_cathasvideo : 0)
+ ((flags.get(Condenser.flag_cat_hasapp)) ? 255 << this.ranking.coeff_cathasapp : 0) + ((flags.get(Tokenizer.flag_cat_hasapp)) ? 255 << this.ranking.coeff_cathasapp : 0)
+ ((ByteBuffer.equals(t.getLanguage(), ASCII.getBytes(this.language))) ? 255 << this.ranking.coeff_language : 0); + ((ByteBuffer.equals(t.getLanguage(), ASCII.getBytes(this.language))) ? 255 << this.ranking.coeff_language : 0);
//if (searchWords != null) r += (yacyURL.probablyWordURL(t.urlHash(), searchWords) != null) ? 256 << ranking.coeff_appurl : 0; //if (searchWords != null) r += (yacyURL.probablyWordURL(t.urlHash(), searchWords) != null) ? 256 << ranking.coeff_appurl : 0;
@ -286,11 +286,11 @@ public class ReferenceOrder {
+ ((flags.get(WordReferenceRow.flag_app_dc_subject)) ? 255 << this.ranking.coeff_app_dc_subject : 0) + ((flags.get(WordReferenceRow.flag_app_dc_subject)) ? 255 << this.ranking.coeff_app_dc_subject : 0)
+ ((flags.get(WordReferenceRow.flag_app_dc_description)) ? 255 << this.ranking.coeff_app_dc_description : 0) + ((flags.get(WordReferenceRow.flag_app_dc_description)) ? 255 << this.ranking.coeff_app_dc_description : 0)
+ ((flags.get(WordReferenceRow.flag_app_emphasized)) ? 255 << this.ranking.coeff_appemph : 0) + ((flags.get(WordReferenceRow.flag_app_emphasized)) ? 255 << this.ranking.coeff_appemph : 0)
+ ((flags.get(Condenser.flag_cat_indexof)) ? 255 << this.ranking.coeff_catindexof : 0) + ((flags.get(Tokenizer.flag_cat_indexof)) ? 255 << this.ranking.coeff_catindexof : 0)
+ ((flags.get(Condenser.flag_cat_hasimage)) ? 255 << this.ranking.coeff_cathasimage : 0) + ((flags.get(Tokenizer.flag_cat_hasimage)) ? 255 << this.ranking.coeff_cathasimage : 0)
+ ((flags.get(Condenser.flag_cat_hasaudio)) ? 255 << this.ranking.coeff_cathasaudio : 0) + ((flags.get(Tokenizer.flag_cat_hasaudio)) ? 255 << this.ranking.coeff_cathasaudio : 0)
+ ((flags.get(Condenser.flag_cat_hasvideo)) ? 255 << this.ranking.coeff_cathasvideo : 0) + ((flags.get(Tokenizer.flag_cat_hasvideo)) ? 255 << this.ranking.coeff_cathasvideo : 0)
+ ((flags.get(Condenser.flag_cat_hasapp)) ? 255 << this.ranking.coeff_cathasapp : 0) + ((flags.get(Tokenizer.flag_cat_hasapp)) ? 255 << this.ranking.coeff_cathasapp : 0)
+ ((this.language.equals(t.language())) ? 255 << this.ranking.coeff_language : 0); + ((this.language.equals(t.language())) ? 255 << this.ranking.coeff_language : 0);
return r; // the higher the number the better the ranking. return r; // the higher the number the better the ranking.
} }

@ -388,7 +388,7 @@ public class cryptbig {
return salt + ((gzFlag) ? "1" : "0") + Base64Order.enhancedCoder.encode(enc); return salt + ((gzFlag) ? "1" : "0") + Base64Order.enhancedCoder.encode(enc);
} }
public static String descrambleString(final String key, String s) throws IOException { public static String descrambleString(final String key, String s) {
final String salt = s.substring(0, 8); final String salt = s.substring(0, 8);
final boolean gzFlag = (s.charAt(8) == '1'); final boolean gzFlag = (s.charAt(8) == '1');
s = s.substring(9); s = s.substring(9);
@ -425,7 +425,7 @@ public class cryptbig {
return null; return null;
} }
public static String simpleDecode(String encoded, final String key) throws IOException { public static String simpleDecode(String encoded, final String key) {
if ((encoded == null) || (encoded.length() < 3)) return null; if ((encoded == null) || (encoded.length() < 3)) return null;
if (encoded.charAt(1) != '|') return encoded; // not encoded if (encoded.charAt(1) != '|') return encoded; // not encoded
final char method = encoded.charAt(0); final char method = encoded.charAt(0);
@ -611,12 +611,7 @@ public class cryptbig {
// 'descramble' string // 'descramble' string
if (s.length != 3) {help(); System.exit(-1);} if (s.length != 3) {help(); System.exit(-1);}
final long t = System.currentTimeMillis(); final long t = System.currentTimeMillis();
try {
System.out.println(descrambleString(s[1], s[2])); System.out.println(descrambleString(s[1], s[2]));
} catch (final IOException e) {
// TODO Auto-generated catch block
ConcurrentLog.logException(e);
}
System.out.println("Calculation time: " + (System.currentTimeMillis() - t) + " milliseconds"); System.out.println("Calculation time: " + (System.currentTimeMillis() - t) + " milliseconds");
System.exit(0); System.exit(0);
} }

Loading…
Cancel
Save