Chunks

A set of Endpoints to discover information about available Chunks.

Important
Indexing of Chunks

Please note that only Chunks with a minimal token length of 15 are indexed. The reason behind that is towfold: 1.) normally one is interested in semantic rich Chunks and 2.) the indexing process and the Solr-Index don’t have to work on millions of simple short Chunks.

Although there are (good) reasons for this decision, this might change in the future.

/api/chunks/search

Returns a list of Chunks, queried on a full-text-index.

Parameter Description

snapshot

The name of the snapshot.

selection

Optional. The name of a selection.

query

The query on the text of the chunk

domain

Optional. A specific domain.

reference

Optional. A reference/path.

maxReferenceSegments

Optional. The max. number of segments in the reference/path (e.g. www.myurl.de/home/new has referenceSegments of 2)

minToken

Optional. Defines the minimum number of tokens in a returned chunk. Defaults to 15

limit

Defines how many results should be returned. Defaults to 100

Example
$ curl 'http://localhost:8080/api/chunks/search?snapshot=20121227_intermediaries&query=forschung&limit=2' -i -X GET
HTTP/1.1 200 OK
X-Rate-Limit-Remaining: 49
Content-Type: application/json
Content-Length: 1130

{
  "responseHeader" : {
    "httpStatus" : null,
    "msg" : "",
    "query" : "http://localhost:8080/api/chunks/search?snapshot=20121227_intermediaries&query=forschung&limit=2",
    "state" : "OK"
  },
  "content" : [ {
    "snapshot" : "20121227_intermediaries",
    "domain" : "www.che.de",
    "reference" : "/cms/?getobject=260&straction=show&pk_projekt=138&getlang=de",
    "referenceSegments" : 2,
    "chunker" : "default",
    "chunkTokenCount" : 15,
    "chunk" : "MDgt. Dr. Josef Glombik,  Abteilungsleiter, Abteilung Wissenschaft und Forschung,  Ministerium für Wissenschaft, Forschung und Kultur"
  }, {
    "snapshot" : "20121227_intermediaries",
    "domain" : "www.che.de",
    "reference" : "/cms/?getobject=260&straction=show&pk_projekt=56&getlang=de",
    "referenceSegments" : 2,
    "chunker" : "default",
    "chunkTokenCount" : 15,
    "chunk" : "MDgt. Dr. Josef Glombik,  Abteilungsleiter, Abteilung Wissenschaft und Forschung,  Ministerium für Wissenschaft, Forschung und Kultur"
  } ],
  "page" : {
    "size" : 2,
    "number" : 0,
    "totalElements" : 2,
    "totalPages" : 1
  },
  "links" : { }
}