Index
Internally the documents (pages) of a Snapshot are indexed using a full-text search-engine.
For search requests based on documents you can use the fiels in the table below:
| Fieldname | Description |
|---|---|
domain_s |
The domain of the web site hosting this page |
path_s |
The complete path of the page, including query parameters |
title_t |
The title of the web page. |
description_t |
A description extracted from the page. |
language_s |
The language of the identified text |
_text_ |
The hidden field for the full-text. It can be queried but the values are not stored in the index. If you need full-texts please use the appropriate API-Call. Normally, you do not have to state this field in queries. |
CSR (1)
"Corporate Social Responsibility" (2)
language_s:de && "Corporate Social Responsibility" (3)
language_s:en && path_s:"/about" (4)
-
Searches for a phrase in the field \_text.
-
Searches for the phrase "Corporate Social Responsibility". Use " to combine single words to a longer phrase.
-
Same as above, but searches only in german documents.
-
Searches for pages with the specified path in english documents.
|
Note
|
Notes and complete Solr-Query-Syntax
As you probably noted the examples do not entail information about a snapshot or panel. This information is added to your query automatically to make sure that only reasonable queries can be submitted to the API. Currently a version of Solr is used. Thus you can use the syntax of Solr to query the full-text index. For further reference, please use for reference the orginal documentation of Solr: |
/api/index/status
Provides an overview of indexed documents per Snapshot and a possible defined Selection.
| Parameter | Description |
|---|---|
|
Optional. The name of a snapshot. Can be specified multiple times. |
|
Optional. The name of a panel. One of 'snapshot' or 'panel' has to be specified. |
|
Optional. The name of a selection to filter the results. |
$ curl 'http://localhost:8080/api/index/status?snapshot=20121227_intermediaries' -i -X GET
HTTP/1.1 200 OK
X-Rate-Limit-Remaining: 49
Content-Type: application/json
Content-Length: 412
{
"responseHeader" : {
"httpStatus" : null,
"msg" : "",
"query" : "http://localhost:8080/api/index/status?snapshot=20121227_intermediaries",
"state" : "OK"
},
"content" : [ {
"snapshot" : "20121227_intermediaries",
"selection" : "",
"indexedDocs" : 223686
} ],
"page" : {
"size" : 1,
"number" : 0,
"totalElements" : 1,
"totalPages" : 1
},
"links" : { }
}
/api/index/searchAggrBySnapshot
Queries a set of snapshots with a set of concepts and the overall number of occurrences of concepts aggregated on snapshots.
| Parameter | Description |
|---|---|
|
Optional. Page size. |
This search method makes use of more complex type "AggregatedSearchQuery". This type allows to specify queries for a set of snapshot and a set of concepts. It is defined as follows:
{
"panel": "intermediaries", (1)
"snapshots": [ ... ], (1)
"searchQueries": [ (2)
{
"name": "University",
"q": "\\"University\\" OR Uni OR College"
}
]
}
-
The fields "panel" or "snapshots" define which snapshots will be searched. Only one of these fields must be specified.
-
The field "searchQueries" is an array of SearchQuery-objects. Each SearchQuery has a name as a label and a query 'q' which is used to search for the concept.
|
Important
|
When using such an AggregatedSearchQuery in a request, you have to specify the AggregatedSearchQuery in the BODY of the request. |
Result: The endpoint returns a Task which then can be queried to obtain the actual results.
Using this endpoint is simple, when using our Python-Client.
query = {
"panel": "intermediaries",
"searchQueries": [
{
"name": "University",
"q": "\\"University\\" OR Uni OR College"
}
]
}
df2 = client.loadAsDF(
"/api/index/searchAggrBySnapshot", body = query)
$ curl 'http://localhost:8080/api/index/searchAggrBySnapshot' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"panel": "intermediaries",
"searchQueries": [
{
"name": "University",
"q": "\"University\" OR Uni OR College"
},
{
"name": "Klima",
"q": "Klima"
}
]
}
'
HTTP/1.1 303 See Other
X-Rate-Limit-Remaining: 48
Location: /api/index/doSearchAggrBySnapshot?taskId=24fa2c23452d0801158b6b2eb149ad7f7a899154&size=1000
Content-Type: application/json
Content-Length: 184
{
"id" : "24fa2c23452d0801158b6b2eb149ad7f7a899154",
"uri" : "/api/index/doSearchAggrBySnapshot?taskId=24fa2c23452d0801158b6b2eb149ad7f7a899154&size=1000",
"description" : null
}