mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
added json(p) endpoint for crawl start
This commit is contained in:
parent
83ba45ebae
commit
369b8e0e0b
|
@ -91,6 +91,16 @@ public class Crawler_p {
|
|||
final serverObjects prop = new serverObjects();
|
||||
prop.put("rejected", 0);
|
||||
|
||||
// check for JSONP
|
||||
if (post != null && post.containsKey("callback") ) {
|
||||
final String jsonp = post.get("callback") + "([";
|
||||
prop.put("jsonp-start", jsonp);
|
||||
prop.put("jsonp-end", "])");
|
||||
} else {
|
||||
prop.put("jsonp-start", "");
|
||||
prop.put("jsonp-end", "");
|
||||
}
|
||||
|
||||
Segment segment = sb.index;
|
||||
Fulltext fulltext = segment.fulltext();
|
||||
String localSolr = "solr/select?core=collection1&q=*:*&start=0&rows=3";
|
||||
|
|
6
htroot/Crawler_p.json
Normal file
6
htroot/Crawler_p.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
#[jsonp-start]#
|
||||
{
|
||||
"success": "true",
|
||||
"comment": "#(info)#::Error with profile management. Please stop YaCy, delete the file DATA/PLASMADB/crawlProfiles0.db and restart. ::Error: #[errmsg]# ::Application not yet initialized. Sorry. Please wait some seconds and repeat the request. ::ERROR: Crawl filter '#[newcrawlingfilter]#' does not match with crawl root '#[crawlingStart]#'.Please try again with different filter.::Crawling of '#[crawlingURL]#' failed. Reason: #[reasonString]#::Error with URL input '#[crawlingStart]#': #[error]#::Error with file input '#[crawlingStart]#': #[error]# ::Crawling of '#[crawlingURL]#' started.#(/info)#"
|
||||
}
|
||||
#[jsonp-end]#
|
Loading…
Reference in New Issue
Block a user