# SearchResults
## Documentation
A search over every source, 100 results per request. The platform reaches only the first thousand or so results of a search and then stops without an error; the driver warns when that happens. Narrow with date_from and date_to, or read the tables of the schema Export for a complete answer. A word matches whole words only: begroting does not find programmabegroting.
- Catalog: `OpenBesluitvorming`
- Schema: `Search`
This is a read-only table function. The Open Besluitvorming API may not support changing the data or the Invantive UniversalSQL driver for Open Besluitvorming does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Open Besluitvorming API.
## Parameters of Table Function
The following parameters can be used to control the behaviour of the table function `SearchResults`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values.
Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three.
Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third.
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `date_from` | `date` | ☐ | | The first day, inclusive. |
| `date_to` | `date` | ☐ | | The last day, inclusive. |
| `entity_type` | `varchar2` | ☐ | | Meeting, Document, Motion or Recording; Recording searches what was said and answers the meeting. |
| `organization` | `varchar2` | ☐ | | A source, such as soest; case sensitive. |
| `query` | `varchar2` | ☐ | | The words to search for, all of them; between double quotes for a phrase. Required unless organization is given. |
| `sort` | `varchar2` | ☐ | | date_desc (the default), date_asc, title_asc or relevance. |
## Columns of Table Function
The columns of the table function `SearchResults` are shown below. Each column has an SQL data type.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `download_url` | `varchar2` | | ☐ | Where the file can be downloaded. |
| `entity_id` | `varchar2` | | ☑ | The meeting, document, motion or recording found. |
| `entity_type_label` | `varchar2` | | ☐ | The kind in Dutch. |
| `entity_type` | `varchar2` | | ☑ | Meeting, Document or Motion; a hit in what was said answers the Meeting. |
| `matched_page` | `int32` | | ☐ | The page of the document that matched. |
| `organization` | `varchar2` | | ☐ | The name of the organisation. |
| `page_count` | `int32` | | ☐ | The number of pages. |
| `preview_image_url` | `varchar2` | | ☐ | An image of the page that matched. |
| `rank` | `int32` | | ☑ | The position in the answer, from 1. |
| `sort_date` | `datetime` | | ☐ | The date the search sorts and filters on, UTC: for a meeting its start, for a document the meeting it was last discussed in. Never the day it was written. Empty for some 3 000 iBabs motions, which a date filter then leaves out. |
| `summary` | `varchar2` | | ☐ | The fragment that matched. |
| `title` | `varchar2` | | ☐ | The title. |