Dev:APIidx

Aus YaCyWiki
Wechseln zu: Navigation, Suche

Generic Index Export

This servlet shall be able to export any kind of indexed data. While that target is designed to be generic it is only defined to export a host index. A host index is a web structure description which explains the link structure between hosts. For each host there is a list of other hosts which link to that given host.

Operations performed when the servlet is called

There is a in-memory stored host index which is used to create the network graphic. That link structure is transformed to an outside format and returned.

Servlet Address

The servlet path is /yacy/idx.json. The full URL is http://<peer-IP>:<peer-port><servlet-path>.

Properties in the http header

The caller must obey the http header rules.

Properties in the http post-arguments

Calls to the servlet can be made using a GET or POST operation. The properties are:

  • object='host' this is the default post property and the only possible value (at this time). The 'host' property means, that a host index shall be exported

Result

The returned document is a json data structure. This is an example:

{
   "version":"0.1",
   "uptime":"0",
   "name":"host",
   "rowdef":"String h-6 {b256}, Cardinal m-4 {b256}, Cardinal c-4 {b256}",
   "idx":{
       "AA8RoY":[{"h":"wXNDeR","m":"16058","c":"1"},{"h":"9BXL1S","m":"16058","c":"256"}],
       "AfGlY4":[{"h":"BGIES4","m":"16058","c":"7911"},{"h":"MsCqV4","m":"16058","c":"1"},{"h":"nmqUsZ","m":"16058","c":"1"}]
   }
}

The 'idx' set contains references denoted by host hashes for each host, also denoted by hash. The host hash is the tail-part of an url-hash, consisting of six characters

Example Usage

http://localhost:8090/yacy/idx.json?object=host