Skip to content

Commit

Permalink
better search timing; prevents '0 results' for very large local
Browse files Browse the repository at this point in the history
indexes >> 10 mio documents
  • Loading branch information
Orbiter committed Mar 19, 2013
1 parent 5512be6 commit 735eb70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions htroot/yacysearchitem.java
Expand Up @@ -104,11 +104,13 @@ public static serverObjects respond(final RequestHeader header, final serverObje
prop.put("navurlBase", QueryParams.navurlBase("html", theSearch.query, null).toString());
final String target_special_pattern = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "");

long timeout = item == 0 ? 10000 : (theSearch.query.isLocal() ? 1000 : 3000);

if (theSearch.query.contentdom == Classification.ContentDomain.TEXT || theSearch.query.contentdom == Classification.ContentDomain.ALL) {
// text search

// generate result object
final ResultEntry result = theSearch.oneResult(item, theSearch.query.isLocal() ? 1000 : 3000);
final ResultEntry result = theSearch.oneResult(item, timeout);
if (result == null) return prop; // no content
final String resultUrlstring = result.urlstring();
final DigestURI resultURL = result.url();
Expand Down Expand Up @@ -261,7 +263,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje

prop.put("content", theSearch.query.contentdom.getCode() + 1); // switch on specific content
//final MediaSnippet ms = theSearch.result().oneImage(item);
final ResultEntry ms = theSearch.oneResult(item, theSearch.query.isLocal() ? 1000 : 5000);
final ResultEntry ms = theSearch.oneResult(item, timeout);
if (ms == null) {
prop.put("content_item", "0");
} else {
Expand Down Expand Up @@ -297,7 +299,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje
// any other media content

// generate result object
final ResultEntry ms = theSearch.oneResult(item, theSearch.query.isLocal() ? 1000 : 5000);
final ResultEntry ms = theSearch.oneResult(item, timeout);
prop.put("content", theSearch.query.contentdom.getCode() + 1); // switch on specific content
if (ms == null) {
prop.put("content_item", "0");
Expand Down

0 comments on commit 735eb70

Please sign in to comment.