diff --git a/htroot/CrawlStartExpert.html b/htroot/CrawlStartExpert.html index 33faf1c87..e3cdb0d25 100644 --- a/htroot/CrawlStartExpert.html +++ b/htroot/CrawlStartExpert.html @@ -56,13 +56,13 @@ if ($("#sitelist").isChecked()) { document.getElementById('rangeDomainDescription').innerHTML ='Restrict to the domains in the link-list'; document.getElementById('rangeSubpathDescription').innerHTML ='Restrict to the subpaths in the link-list'; - + if ($("#rangeWide").isChecked()) { // we allow also #rangeSubpath $('#rangeDomain').check(); } } - + // Delete only old if ($('#deleteoldage').isChecked()) { $('#deleteIfOlderNumber, #deleteIfOlderUnit').enable(); @@ -100,15 +100,15 @@ // Remote crawl var remoteCrawlerDisabledInfo = document.getElementById('remoteCrawlerDisabledInfo'); if ($('#crawlOrder').isChecked()) { - if(remoteCrawlerDisabledInfo != null) { - remoteCrawlerDisabledInfo.className = ''; - } + if(remoteCrawlerDisabledInfo != null) { + remoteCrawlerDisabledInfo.className = ''; + } $('#intention').enable(); if (cId === "crawlOrder") { $('#intention').focus(); } } else { - if(remoteCrawlerDisabledInfo != null) { - remoteCrawlerDisabledInfo.className = 'hidden'; - } + if(remoteCrawlerDisabledInfo != null) { + remoteCrawlerDisabledInfo.className = 'hidden'; + } $('#intention').disable(); } } @@ -206,23 +206,23 @@ //]]> - + #%env/templates/header.template%# #%env/templates/submenuIndexCreate.template%# - +
API Click on this API button to see a documentation of the POST request parameter for crawl starts.

Expert Crawl Start

- +

Start Crawling Job:  You can define URLs as start points for Web page crawling and start crawling here. @@ -230,7 +230,7 @@ This is repeated as long as specified under "Crawling Depth". A crawl can also be started using wget and the post arguments for this web page.

- +
Crawl Job @@ -248,30 +248,30 @@   -
- empty - -
-
- -
-
From Link-List of URL
-
-
+
+ empty +
+
+
+ +
+
From Link-List of URL
+
+
-
-
From Sitemap
-
- -
-
From File (enter a path
within your local file system)
-
- -
- + +
From Sitemap
+
+ +
+
From File (enter a path
within your local file system)
+
+ +
+
Crawler Filter @@ -305,7 +305,7 @@ : - +
info @@ -319,29 +319,29 @@ Obey html-robots-nofollow:
-
Media Type detection
-
-
- Media Type checking info - - Not loading URLs with unsupported file extension is faster but less accurate. - Indeed, for some web resources the actual Media Type is not consistent with the URL file extension. Here are some examples: - - -
- - -
-
Load Filter on URLs
-
info +
Media Type detection
+
+
+ Media Type checking info + + Not loading URLs with unsupported file extension is faster but less accurate. + Indeed, for some web resources the actual Media Type is not consistent with the URL file extension. Here are some examples: + + +
+ + +
+
Load Filter on URLs
+
info The filter is a regular expression. Example: to allow only urls that contain the word 'science', set the must-match filter to '.*science.*'. You can also use an automatic domain-restriction to fully crawl a single domain. @@ -349,159 +349,159 @@ - - - - + + + + -
must-match
Restrict to start domain(s)
Restrict to sub-path(s)
Use filter (must not be empty)
Restrict to start domain(s)
Restrict to sub-path(s)
Use filter (must not be empty)
must-not-match
-
- -
Load Filter on URL origin of links
-
- - info - - The filter is a regular expression. - Example: to allow loading only links from pages on example.org domain, set the must-match filter to '.*example.org.*'. - Attention: you can test the functionality of your regular expressions using the Regular Expression Tester within YaCy. - - - - - - - - - - - -
must-match (must not be empty)
must-not-match
-
- -
Load Filter on IPs
-
+ +
+ +
Load Filter on URL origin of links
+
+ + info + + The filter is a regular expression. + Example: to allow loading only links from pages on example.org domain, set the must-match filter to '.*example.org.*'. + Attention: you can test the functionality of your regular expressions using the Regular Expression Tester within YaCy. + + + + + + + + + + + +
must-match (must not be empty)
must-not-match
+
+ +
Load Filter on IPs
+
- -
must-match (must not be empty)
must-not-match
-
+ must-not-match + +
info Crawls can be restricted to specific countries. This uses the country code that can be computed from the IP of the server that hosts the page. The filter is not a regular expressions but a list of country codes, separated by comma. - no country code restriction
- Use filter   - -
- + no country code restriction
+ Use filter   + + +
Document Filter

These are limitations on index feeder. The filters will be applied after a web page was loaded.

-
Filter on URLs
-
+
Filter on URLs
+
info The filter is a regular expression that must not match with the URLs to allow that the content of the url is indexed. Attention: you can test the functionality of your regular expressions using the Regular Expression Tester within YaCy. - - -
must-match (must not be empty)
must-not-match
-
-
Filter on Content of Document
(all visible text, including camel-case-tokenized url and title)
-
+ must-match (must not be empty) + must-not-match + +
+
Filter on Content of Document
(all visible text, including camel-case-tokenized url and title)
+
- - -
must-match (must not be empty)
must-not-match
-
-
Filter on Document Media Type (aka MIME type)
-
-
- Media Type filter info - - The filter is a regular expression - that must match with the document Media Type (also known as MIME Type) to allow the URL to be indexed. - Standard Media Types are described at the IANA registry. - Attention: you can test the functionality of your regular expressions using the Regular Expression Tester within YaCy. - -
- - - - - - - - - -
must-match
must-not-match
-
-
Solr query filter on any active indexed field(s)
-
-
- Solr query filter info - - Each parsed document is checked against the given Solr query before being added to the index. - The query must be written in respect to the standard Solr query syntax. - -
- - #(embeddedSolrConnected)# - - - - :: - - - - - - - - - #(/embeddedSolrConnected)# -
-

The embedded local Solr index must be connected to use this kind of filter.

-

You can configure this with the Index Sources & targets page.

-
must-match - -
must-not-match - -
-
-
+ must-match (must not be empty) + must-not-match + + +
Filter on Document Media Type (aka MIME type)
+
+
+ Media Type filter info + + The filter is a regular expression + that must match with the document Media Type (also known as MIME Type) to allow the URL to be indexed. + Standard Media Types are described at the IANA registry. + Attention: you can test the functionality of your regular expressions using the Regular Expression Tester within YaCy. + +
+ + + + + + + + + +
must-match
must-not-match
+
+
Solr query filter on any active indexed field(s)
+
+
+ Solr query filter info + + Each parsed document is checked against the given Solr query before being added to the index. + The query must be written in respect to the standard Solr query syntax. + +
+ + #(embeddedSolrConnected)# + + + + :: + + + + + + + + + #(/embeddedSolrConnected)# +
+

The embedded local Solr index must be connected to use this kind of filter.

+

You can configure this with the Index Sources & targets page.

+
must-match + +
must-not-match + +
+
+
Content Filter

These are limitations on parts of a document. The filter will be applied after a web page was loaded.

-
Filter div or nav class names
-
+
Filter div or nav class names
+
- -
set of CSS class namescomma-separated list of <div> or <nav> element class names which should be filtered out
-
-
+ set of CSS class namescomma-separated list of <div> or <nav> element class names which should be filtered out + + +
Clean-Up before Crawl Start
- -
- Clean up search events cache info - - Check this option to be sure to get fresh search results including newly crawled documents. Beware that it will also interrupt any refreshing/resorting of search results currently requested from browser-side. - -
+ +
+ Clean up search events cache info + + Check this option to be sure to get fresh search results including newly crawled documents. Beware that it will also interrupt any refreshing/resorting of search results currently requested from browser-side. + +
No Deletion
info @@ -511,9 +511,9 @@ Do not delete any document before the crawl is started.
Delete sub-path
For each host in the start url list, delete all documents (in the given subpath) from that host.
-
Delete only old
-
Treat documents that are loaded - Treat documents that are loaded + ago as stale and delete them before the crawl is started. -
-
+ +
Double-Check Rules @@ -535,8 +535,8 @@ then the url is treated as double when you check the 'no doubles' option. A url may be loaded again when it has reached a specific age, to use that check the 're-load' option. Never load any page that is already known. Only the start-url may be loaded again. -
Re-load
-
Treat documents that are loaded +
Re-load
+
Treat documents that are loaded ago as stale and load them again. If they are younger, they are ignored. -
- + +
Document Cache @@ -569,36 +569,35 @@ if exist: use the cache if the cache exist. Do no check freshness. Otherwise use online source; cache only: never go online, use all content from cache. If no cache exist, treat content as unavailable - no cache    - if fresh    - if exist    - cache only - - + no cache    + if fresh    + if exist    + cache only + +
- #(agentSelect)#:: +
Robot Behaviour
info - You are running YaCy in non-p2p mode and because YaCy can be used as replacement for commercial search appliances - (like the GSA) the user must be able to crawl all web pages that are granted to such commercial plattforms. + Because YaCy can be used as replacement for commercial search appliances + (like the Google Search Appliance aka GSA) the user must be able to crawl all web pages that are granted to such commercial platforms. Not having this option would be a strong handicap for professional usage of this software. Therefore you are able to select alternative user agents here which have different crawl timings and also identify itself with another user agent and obey the corresponding robots rule. - + #{list}# - #{/list}# - -
-
+ #{/list}# + + +
- #(/agentSelect)# - - #(vocabularySelect)#:: + + #(vocabularySelect)#::
Enrich Vocabulary
@@ -609,18 +608,18 @@ - #{vocabularyset}# - - - - + #{vocabularyset}# + + + + #{/vocabularyset}#
VocabularyClass
#[name]#
#[name]#
- -
+ +
- #(/vocabularySelect)# - + #(/vocabularySelect)# +
Snapshot Creation
@@ -633,12 +632,12 @@ means a snapshot is only be generated if the crawl depth of a document is smaller or equal to the given number here. If the number is set to -1, no snapshots are generated. - - + +
replace old snapshots with new one    - add new versions for each crawl + add new versions for each crawl
@@ -647,14 +646,14 @@
Only XML snapshots can be generated. as the wkhtmltopdf util is not found by YaCy on your system. - It is required to generate PDF snapshots from crawled pages that can then be converted to images.
+ It is required to generate PDF snapshots from crawled pages that can then be converted to images.
::
- #(/snapshotEnableImages)# -
+ #(/snapshotEnableImages)# +
Index Attributes @@ -683,11 +682,11 @@ #(remoteCrawlerDisabled)#:: - - - #(/remoteCrawlerDisabled)# + + + #(/remoteCrawlerDisabled)#

Remote crawl results won't be added to the local index as the remote crawler is disabled on this peer.

-

You can activate it in the Remote Crawl Configuration page.

-

Remote crawl results won't be added to the local index as the remote crawler is disabled on this peer.

+

You can activate it in the Remote Crawl Configuration page.

+
@@ -709,9 +708,9 @@ These tags can be selected with the GSA interface using the 'site' operator. To use this option, the 'collection_sxt'-field must be switched on in the Solr Schema - - - + + +
info @@ -720,18 +719,18 @@ from dates without time zones to UTC, this offset must be given here. The offset is given in minutes; Time zone offsets for locations east of UTC must be negative; offsets for zones west of UTC must be positve. - -
- - + + + + -
+
- + #%env/templates/footer.template%# diff --git a/htroot/CrawlStartExpert.java b/htroot/CrawlStartExpert.java index d73b70c43..635b76177 100644 --- a/htroot/CrawlStartExpert.java +++ b/htroot/CrawlStartExpert.java @@ -71,7 +71,7 @@ public class CrawlStartExpert { } else { prop.put("starturl", ""); } - + // sitemap URL if (post != null && post.containsKey("sitemapURL")) { final String sitemapURL = post.get("sitemapURL", ""); @@ -83,7 +83,7 @@ public class CrawlStartExpert { } else { prop.put("sitemapURL", ""); } - + // crawling file if (post != null && post.containsKey("crawlingFile")) { final String crawlingFile = post.get("crawlingFile", ""); @@ -144,12 +144,10 @@ public class CrawlStartExpert { } else { prop.put("bookmarkTitle", ""); } - // ---------- Crawling filter - final int crawlingDomMaxPages = env.getConfigInt( - "crawlingDomMaxPages", -1); - + final int crawlingDomMaxPages = env.getConfigInt("crawlingDomMaxPages", -1); + // crawling depth if (post != null && post.containsKey("crawlingDepth")) { final Integer depth = post.getInt("crawlingDepth", -1); @@ -213,13 +211,13 @@ public class CrawlStartExpert { prop.put("obeyHtmlRobotsNoindexChecked", post.getBoolean("obeyHtmlRobotsNoindex") ? 1 : 0); prop.put("obeyHtmlRobotsNofollowChecked", post.getBoolean("obeyHtmlRobotsNofollow") ? 1 : 0); } - + // always cross-check URL file extension against actual Media Type ? - if (post == null) { - prop.put("crawlerAlwaysCheckMediaType", true); - } else { - prop.put("crawlerAlwaysCheckMediaType", post.getBoolean("crawlerAlwaysCheckMediaType")); - } + if (post == null) { + prop.put("crawlerAlwaysCheckMediaType", true); + } else { + prop.put("crawlerAlwaysCheckMediaType", post.getBoolean("crawlerAlwaysCheckMediaType")); + } // Load Filter on URLs (range) if (post != null && post.containsKey("range")) { @@ -248,22 +246,22 @@ public class CrawlStartExpert { } else { prop.put("mustnotmatch", CrawlProfile.MATCH_NEVER_STRING); } - - // Filter on URL origin of links: must match - if (post != null && post.containsKey(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key)) { - prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, - post.get(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING)); - } else { - prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING); - } - - // Filter on URL origin of links: must-not-match - if (post != null && post.containsKey(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key)) { - prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, - post.get(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING)); - } else { - prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING); - } + + // Filter on URL origin of links: must match + if (post != null && post.containsKey(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key)) { + prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, + post.get(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING)); + } else { + prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING); + } + + // Filter on URL origin of links: must-not-match + if (post != null && post.containsKey(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key)) { + prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, + post.get(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING)); + } else { + prop.put(CrawlAttribute.CRAWLER_ORIGIN_URL_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING); + } // Load Filter on IPs: must match if (post != null && post.containsKey("ipMustmatch")) { @@ -329,45 +327,45 @@ public class CrawlStartExpert { } else { prop.put("indexcontentmustnotmatch", CrawlProfile.MATCH_NEVER_STRING); } - - // Filter on Media Type of Document: must match - if (post != null && post.containsKey(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key)) { - prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, - post.get(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING)); - } else { - prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING); - } - - // Filter on Media Type of Document: must-not-match - if (post != null && post.containsKey(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key)) { - prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, - post.get(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING)); - } else { - prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING); - } - - // Filter with a Solr syntax query - /* Check that the embedded local Solr index is connected, as its schema is required to apply the eventual Solr filter query */ - final EmbeddedInstance embeddedSolr = sb.index.fulltext().getEmbeddedInstance(); - final SolrCore embeddedCore = embeddedSolr != null ? embeddedSolr.getDefaultCore() : null; - final boolean embeddedSolrConnected = embeddedSolr != null && embeddedCore != null; - prop.put("embeddedSolrConnected", embeddedSolrConnected); - - if(embeddedSolrConnected) { - if (post != null && post.containsKey(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key)) { - prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, - post.get(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, CrawlProfile.SOLR_MATCH_ALL_QUERY).trim()); - } else { - prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, CrawlProfile.SOLR_MATCH_ALL_QUERY); - } - - if (post != null && post.containsKey(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key)) { - prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, - post.get(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, CrawlProfile.SOLR_EMPTY_QUERY).trim()); - } else { - prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, CrawlProfile.SOLR_EMPTY_QUERY); - } - } + + // Filter on Media Type of Document: must match + if (post != null && post.containsKey(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key)) { + prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, + post.get(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING)); + } else { + prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTMATCH.key, CrawlProfile.MATCH_ALL_STRING); + } + + // Filter on Media Type of Document: must-not-match + if (post != null && post.containsKey(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key)) { + prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, + post.get(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING)); + } else { + prop.put(CrawlAttribute.INDEXING_MEDIA_TYPE_MUSTNOTMATCH.key, CrawlProfile.MATCH_NEVER_STRING); + } + + // Filter with a Solr syntax query + /* Check that the embedded local Solr index is connected, as its schema is required to apply the eventual Solr filter query */ + final EmbeddedInstance embeddedSolr = sb.index.fulltext().getEmbeddedInstance(); + final SolrCore embeddedCore = embeddedSolr != null ? embeddedSolr.getDefaultCore() : null; + final boolean embeddedSolrConnected = embeddedSolr != null && embeddedCore != null; + prop.put("embeddedSolrConnected", embeddedSolrConnected); + + if(embeddedSolrConnected) { + if (post != null && post.containsKey(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key)) { + prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, + post.get(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, CrawlProfile.SOLR_MATCH_ALL_QUERY).trim()); + } else { + prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTMATCH.key, CrawlProfile.SOLR_MATCH_ALL_QUERY); + } + + if (post != null && post.containsKey(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key)) { + prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, + post.get(CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, CrawlProfile.SOLR_EMPTY_QUERY).trim()); + } else { + prop.put("embeddedSolrConnected_" + CrawlAttribute.INDEXING_SOLR_QUERY_MUSTNOTMATCH.key, CrawlProfile.SOLR_EMPTY_QUERY); + } + } // ---------- Clean-Up before Crawl Start @@ -433,18 +431,17 @@ public class CrawlStartExpert { } else { prop.put("deleteIfOlderUnitSelect_list_2_default", 1); } - - + // clean up search events cache ? if (post != null && post.containsKey("cleanSearchCache")) { - prop.put("cleanSearchCacheChecked", post.getBoolean("cleanSearchCache")); + prop.put("cleanSearchCacheChecked", post.getBoolean("cleanSearchCache")); } else { - /* - * no parameter passed : the checkbox is proposed unchecked - * when JavaScript search resort is enabled, as it heavily relies on search events cache - */ - prop.put("cleanSearchCacheChecked", !sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, - SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT)); + /* + * no parameter passed : the checkbox is proposed unchecked + * when JavaScript search resort is enabled, as it heavily relies on search events cache + */ + prop.put("cleanSearchCacheChecked", !sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, + SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT)); } // delete any document before the crawl is started? @@ -547,7 +544,7 @@ public class CrawlStartExpert { prop.put("storeHTCacheChecked", post.getBoolean("storeHTCache") ? 1 : 0); } - + // Policy for usage of Web Cache if (post != null && post.containsKey("cachePolicy")) { final String cachePolicy = post.get("cachePolicy", ""); @@ -565,35 +562,29 @@ public class CrawlStartExpert { } // ---------- Agent name - if (sb.isP2PMode()) { - prop.put("agentSelect", 0); - } else { - prop.put("agentSelect", 1); - List agentNames = new ArrayList(); - if (sb.isIntranetMode()) { - agentNames.add(ClientIdentification.yacyIntranetCrawlerAgentName); - } - if (sb.isGlobalMode()) { - agentNames.add(ClientIdentification.yacyInternetCrawlerAgentName); - } - agentNames.add(ClientIdentification.googleAgentName); - if (sb.isAllIPMode()) { - agentNames.add(ClientIdentification.browserAgentName); - if (ClientIdentification.getAgent(ClientIdentification.customAgentName) != null) agentNames.add(ClientIdentification.customAgentName); - } - String defaultAgentName = agentNames.get(0); - if (post != null && post.containsKey("agentName")) { - String agentName = post.get("agentName", sb.isIntranetMode() ? ClientIdentification.yacyIntranetCrawlerAgentName : ClientIdentification.yacyInternetCrawlerAgentName); - if (agentNames.contains(agentName)) defaultAgentName = agentName; - } - for (int i = 0; i < agentNames.size(); i++) { - prop.put("agentSelect_list_" + i + "_name", agentNames.get(i)); - prop.put("agentSelect_list_" + i + "_default", agentNames.get(i).equals(defaultAgentName) ? 1 : 0); - } - prop.put("agentSelect_list", agentNames.size()); - + List agentNames = new ArrayList(); + if (sb.isIntranetMode()) { + agentNames.add(ClientIdentification.yacyIntranetCrawlerAgentName); + } + if (sb.isGlobalMode()) { + agentNames.add(ClientIdentification.yacyInternetCrawlerAgentName); + } + agentNames.add(ClientIdentification.googleAgentName); + if (sb.isAllIPMode()) { + agentNames.add(ClientIdentification.browserAgentName); + if (ClientIdentification.getAgent(ClientIdentification.customAgentName) != null) agentNames.add(ClientIdentification.customAgentName); } - prop.put("agentSelect_defaultAgentName", ClientIdentification.yacyInternetCrawlerAgentName); + String defaultAgentName = agentNames.get(0); + if (post != null && post.containsKey("agentName")) { + String agentName = post.get("agentName", sb.isIntranetMode() ? ClientIdentification.yacyIntranetCrawlerAgentName : ClientIdentification.yacyInternetCrawlerAgentName); + if (agentNames.contains(agentName)) defaultAgentName = agentName; + } + for (int i = 0; i < agentNames.size(); i++) { + prop.put("list_" + i + "_name", agentNames.get(i)); + prop.put("list_" + i + "_default", agentNames.get(i).equals(defaultAgentName) ? 1 : 0); + } + prop.put("list", agentNames.size()); + prop.put("defaultAgentName", sb.isIntranetMode() ? ClientIdentification.yacyIntranetCrawlerAgentName : ClientIdentification.yacyInternetCrawlerAgentName); // ---------- Ignore Class Name if (post != null && post.containsKey("ignoreclassname")) { @@ -602,7 +593,7 @@ public class CrawlStartExpert { } else { prop.put("ignoreclassname", ""); } - + // ---------- Enrich Vocabulary Collection vocs = LibraryProvider.autotagging.getVocabularies(); if (vocs.size() == 0) { @@ -618,7 +609,7 @@ public class CrawlStartExpert { } prop.put("vocabularySelect_vocabularyset", count); } - + // ---------- Snapshot generation boolean wkhtmltopdfAvailable = Html2Image.wkhtmltopdfAvailable(); //boolean convertAvailable = Html2Image.convertAvailable(); @@ -643,9 +634,9 @@ public class CrawlStartExpert { // Do Remote Indexing? if (sb.isP2PMode()) { prop.put("remoteindexing", 1); - prop.put("remoteindexing_remoteCrawlerDisabled", - !sb.getConfigBool(SwitchboardConstants.CRAWLJOB_REMOTE, false)); - prop.put("remoteindexing_remoteCrawlerDisabled_crawlOrderChecked", env.getConfigBool("crawlOrder", true)); + prop.put("remoteindexing_remoteCrawlerDisabled", + !sb.getConfigBool(SwitchboardConstants.CRAWLJOB_REMOTE, false)); + prop.put("remoteindexing_remoteCrawlerDisabled_crawlOrderChecked", env.getConfigBool("crawlOrder", true)); prop.put("remoteindexing_crawlOrderChecked", env.getConfigBool("crawlOrder", true)); prop.put("remoteindexing_intention", ""); } else { @@ -658,9 +649,9 @@ public class CrawlStartExpert { post.getBoolean("indexMedia") ? 1 : 0); if (sb.isP2PMode()) { prop.put("remoteindexing", 1); - prop.put("remoteindexing_remoteCrawlerDisabled", - !sb.getConfigBool(SwitchboardConstants.CRAWLJOB_REMOTE, false)); - prop.put("remoteindexing_remoteCrawlerDisabled_crawlOrderChecked", post.getBoolean("crawlOrder")); + prop.put("remoteindexing_remoteCrawlerDisabled", + !sb.getConfigBool(SwitchboardConstants.CRAWLJOB_REMOTE, false)); + prop.put("remoteindexing_remoteCrawlerDisabled_crawlOrderChecked", post.getBoolean("crawlOrder")); prop.put("remoteindexing_crawlOrderChecked", post.getBoolean("crawlOrder")); prop.put("remoteindexing_intention", post.get("intention", "")); } else { @@ -681,7 +672,7 @@ public class CrawlStartExpert { prop.put("collection", collectionEnabled ? defaultCollection : ""); } } - + // return rewrite properties return prop; } diff --git a/source/net/yacy/cora/protocol/ClientIdentification.java b/source/net/yacy/cora/protocol/ClientIdentification.java index 266c6ef91..761b65551 100644 --- a/source/net/yacy/cora/protocol/ClientIdentification.java +++ b/source/net/yacy/cora/protocol/ClientIdentification.java @@ -33,7 +33,7 @@ public class ClientIdentification { public static final int clientTimeoutInit = 10000; public static final int minimumLocalDeltaInit = 10; // the minimum time difference between access of the same local domain - public static final int minimumGlobalDeltaInit = 500; // the minimum time difference between access of the same global domain + public static final int minimumGlobalDeltaInit = 250; // the minimum time difference between access of the same global domain public static class Agent { public final String userAgent; // the name that is send in http request to identify the agent