diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index 80c2f6628..f37897e14 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -218,7 +218,7 @@ public class yacysearchitem { prop.putHTML("content_publisher", result.publisher()); prop.putHTML("content_creator", result.creator());// author prop.putHTML("content_subject", result.subject()); - final List query = theSearch.query.getQueryGoal().getAllStrings(); + final List query = theSearch.query.getQueryGoal().getIncludeStrings(); final StringBuilder s = new StringBuilder(query.size() * 20); for (final String t: query) { s.append('+').append(t); diff --git a/source/net/yacy/search/query/QueryGoal.java b/source/net/yacy/search/query/QueryGoal.java index 1d7bea888..4c2ddbd2f 100644 --- a/source/net/yacy/search/query/QueryGoal.java +++ b/source/net/yacy/search/query/QueryGoal.java @@ -49,18 +49,16 @@ public class QueryGoal { private String query_original; private HandleSet include_hashes, exclude_hashes; - private final ArrayList include_words, exclude_words, all_words; - private final ArrayList include_strings, exclude_strings, all_strings; + private final ArrayList include_words, exclude_words; + private final ArrayList include_strings, exclude_strings; public QueryGoal(HandleSet include_hashes, HandleSet exclude_hashes) { this.query_original = null; this.include_words = new ArrayList(); this.exclude_words = new ArrayList(); - this.all_words = new ArrayList(); this.include_strings = new ArrayList(); this.exclude_strings = new ArrayList(); - this.all_strings = new ArrayList(); this.include_hashes = include_hashes; this.exclude_hashes = exclude_hashes; } @@ -71,10 +69,8 @@ public class QueryGoal { this.query_original = query_original; this.include_words = new ArrayList(); this.exclude_words = new ArrayList(); - this.all_words = new ArrayList(); this.include_strings = new ArrayList(); this.exclude_strings = new ArrayList(); - this.all_strings = new ArrayList(); // remove funny symbols query_words = CharacterCoding.html2unicode(AbstractScraper.stripAllTags(query_words.toCharArray())).toLowerCase().trim(); @@ -86,11 +82,11 @@ public class QueryGoal { } // parse first quoted strings - parseQuery(query_words, this.include_strings, this.exclude_strings, this.all_strings); - + parseQuery(query_words, this.include_strings, this.exclude_strings); + // .. end then take these strings apart to generate word lists - for (String s: this.include_strings) parseQuery(s, this.include_words, this.include_words, this.all_words); - for (String s: this.exclude_strings) parseQuery(s, this.exclude_words, this.exclude_words, this.all_words); + for (String s: this.include_strings) parseQuery(s, this.include_words, this.include_words); + for (String s: this.exclude_strings) parseQuery(s, this.exclude_words, this.exclude_words); WordCache.learn(this.include_strings); WordCache.learn(this.exclude_strings); @@ -111,7 +107,7 @@ public class QueryGoal { * sq = '\'' * dq = '"' */ - private static void parseQuery(String s, ArrayList include_string, ArrayList exclude_string, ArrayList all_string) { + private static void parseQuery(String s, ArrayList include_string, ArrayList exclude_string) { while (s.length() > 0) { // parse query int p = 0; @@ -135,7 +131,6 @@ public class QueryGoal { p++; // go behind the stop character (eats up space, sq and dq) s = p < s.length() ? s.substring(p) : ""; if (string.length() > 0) { - if (!all_string.contains(string)) all_string.add(string); if (inc) { if (!include_string.contains(string)) include_string.add(string); } else { @@ -195,11 +190,7 @@ public class QueryGoal { for (String e: this.exclude_strings) if (t.indexOf(e.toLowerCase()) >= 0) return false; return true; } - - public ArrayList getAllStrings() { - return all_strings; - } - + public void filterOut(final SortedSet blueList) { // filter out words that appear in this set // this is applied to the queryHashes