apply remote result count config value to Bookmark Autosearch

+ prepare to make the widely unused Bookmark feature optional
pull/41/merge
reger 9 years ago
parent 5d635879f8
commit ed3e16e092

@ -157,6 +157,7 @@ public class AutoSearch extends AbstractBusyThread {
* @return true if new query from bookmark was added * @return true if new query from bookmark was added
*/ */
private boolean checkBookmarkDB() { private boolean checkBookmarkDB() {
if (Switchboard.getSwitchboard().bookmarksDB != null) {
int added = 0; int added = 0;
Iterator<Bookmark> it = Switchboard.getSwitchboard().bookmarksDB.getBookmarksIterator(); Iterator<Bookmark> it = Switchboard.getSwitchboard().bookmarksDB.getBookmarksIterator();
if (it != null) { if (it != null) {
@ -183,6 +184,7 @@ public class AutoSearch extends AbstractBusyThread {
saveasPropFile(); saveasPropFile();
return true; return true;
} }
}
return false; return false;
} }
@ -243,7 +245,7 @@ public class AutoSearch extends AbstractBusyThread {
// use remote defaults and ranking (to query their index right) // use remote defaults and ranking (to query their index right)
solrQuery.set(CommonParams.Q, currentQuery + " AND (" + CollectionSchema.httpstatus_i.name() + ":200)"); // except this yacy special solrQuery.set(CommonParams.Q, currentQuery + " AND (" + CollectionSchema.httpstatus_i.name() + ":200)"); // except this yacy special
solrQuery.set("q.op", "AND"); // except ... no one word matches please solrQuery.set("q.op", "AND"); // except ... no one word matches please
solrQuery.set(CommonParams.ROWS, "20"); solrQuery.set(CommonParams.ROWS, sb.getConfig(SwitchboardConstants.REMOTESEARCH_MAXCOUNT_USER, "20"));
this.setName("Protocol.solrQuery(" + solrQuery.getQuery() + " to " + seed.hash + ")"); this.setName("Protocol.solrQuery(" + solrQuery.getQuery() + " to " + seed.hash + ")");
try { try {
RemoteInstance instance = new RemoteInstance("http://" + seed.getPublicAddress(seed.getIP()) + "/solr/", null, null, 10000); // this is a 'patch configuration' which considers 'solr' as default collection RemoteInstance instance = new RemoteInstance("http://" + seed.getPublicAddress(seed.getIP()) + "/solr/", null, null, 10000); // this is a 'patch configuration' which considers 'solr' as default collection
@ -278,7 +280,7 @@ public class AutoSearch extends AbstractBusyThread {
rssSearchServiceURL, rssSearchServiceURL,
currentQuery, currentQuery,
0, 0,
20, sb.getConfigInt(SwitchboardConstants.REMOTESEARCH_MAXCOUNT_USER, 20),
CacheStrategy.IFFRESH, CacheStrategy.IFFRESH,
false, // just local, as we ask others too false, // just local, as we ask others too
ClientIdentification.yacyInternetCrawlerAgent); ClientIdentification.yacyInternetCrawlerAgent);

Loading…
Cancel
Save