Skip to content
Snippets Groups Projects
Commit eef3b1f7 authored by Matthijs Brouwer's avatar Matthijs Brouwer
Browse files

documentation heatmap

parent bbd0bd70
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,6 @@ import java.util.regex.Pattern;
import mtas.analysis.token.MtasToken;
import mtas.analysis.token.MtasTokenString;
import mtas.codec.util.CodecComponent.SubComponentFunction;
import mtas.codec.util.CodecSearchTree.MtasTreeHit;
import mtas.codec.util.collector.MtasDataCollector;
import mtas.codec.util.distance.Distance;
......@@ -44,8 +43,6 @@ import mtas.parser.function.ParseException;
import mtas.parser.function.util.MtasFunctionParserFunction;
import mtas.parser.function.util.MtasFunctionParserFunctionDefault;
import mtas.search.spans.util.MtasSpanQuery;
import mtas.solr.handler.component.util.MtasSolrComponentHeatmap;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.lucene.spatial.prefix.PrefixTreeStrategy;
......
......@@ -7,7 +7,7 @@ To perform specific Mtas queries in Solr requests, the following parameter shoul
| mtas | true | yes |
See [statistics](search_component_stats.html),
[kwic](search_component_kwic.html), [list](search_component_list.html), [page](search_component_page.html), [document](search_component_document.html), [termvector](search_component_termvector.html), [facet](search_component_facet.html), [group](search_component_group.html), [prefix](search_component_prefix.html) and [collection](search_component_collection.html) for more details and examples.
[kwic](search_component_kwic.html), [list](search_component_list.html), [page](search_component_page.html), [document](search_component_document.html), [termvector](search_component_termvector.html), [facet](search_component_facet.html), [group](search_component_group.html), [heatmap](search_component_heatmap.html), [prefix](search_component_prefix.html) and [collection](search_component_collection.html) for more details and examples.
---
......
# Heatmap
Mtas can compute geographical distribution for Mtas queries. To get these heatmaps, in Solr requests, besides the parameter to enable the [Mtas query component](search_component.html), the following parameter should be provided.
| Parameter | Value | Obligatory |
|-----------------------|--------|-------------|
| mtas.heatmap | true | yes |
Multiple heatmaps can be produced within the same request. To distinguish them, a unique identifier has to be provided for each of the required document results.
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.heatmap.\<identifier\>.key | \<string\> | key used in response | no |
## Queries
One or multiple queries on the defined Mtas field have to be defined
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.type | \<string\> | query language: [cql](search_cql.html) | yes |
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.value | \<string\> | query: [cql](search_cql.html) | yes |
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.prefix | \<string\> | default prefix | no |
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.ignore | \<string\> | ignore query: [cql](search_cql.html) | no |
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.maximumIgnoreLength | \<integer\> | maximum number of succeeding occurrences to ignore | no |
### Variables
The query may contain one or more variables, and the value(s) of these variables have to be defined
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.variable.\<identifier variable\>.name | \<string\> | name of variable | yes |
| mtas.heatmap.\<identifier\>.query.\<identifier query\>.variable.\<identifier variable\>.value | \<string\> | comma separated list of values | yes |
## Geospatial
One geospatial field has to be defined, and like for the Solr facet.heatmap several parameters can be configured.
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.heatmap.\<identifier\>.heatmapField | \<string\> | Geospatial field | yes |
| mtas.heatmap.\<identifier\>.geom | \<string\> | The region to compute the heatmap on, specified using the rectangle-range syntax or WKT. It defaults to the world. | no |
| mtas.heatmap.\<identifier\>.gridLevel | \<integer\> | A specific grid level, which determines how big each grid cell is. Defaults to being computed via distErrPct (or distErr). | no |
| mtas.heatmap.\<identifier\>.distErrPct | \<double\> | A fraction of the size of geom used to compute gridLevel. Defaults to 0.15. It’s computed the same as a similarly named parameter for RPT. | no |
| mtas.heatmap.\<identifier\>.distErr | \<double\> | A cell error distance used to pick the grid level indirectly. It’s computed the same as a similarly named parameter for RPT. | no |
| mtas.heatmap.\<identifier\>.maxCells | \<integer\> | The maximum number of cells. | no |
# Statistics
Optionally, the type of statistics and minimum/maximum number of occurrences can be defined.
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-| mtas.heatmap.\<identifier\>.type | \<string\> | required [type of statistics](search_stats.html) | no |
| mtas.heatmap.\<identifier\>.minimum | \<double\> | minimum number of occurrences span | no |
| mtas.heatmap.\<identifier\>.maximum | \<double\> | maximum number of occurrences span | no |
### Functions
To compute statistics for values based on the occurrence of one or multiple spans, optionally [functions](search_functions.html) can be added. The parameters for these functions are the number of occurrences *$q0*, *$q1*, ... for each query and the number of positions *$n* in a document. Statistics on the value computed for each document in the set are added to the response.
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.heatmap.\<identifier\>.function.\<identifier function\>.key | \<string\> | key used in response | no |
| mtas.heatmap.\<identifier\>.function.\<identifier function\>.expression | \<string\> | see [functions](search_functions.html) | yes |
| mtas.heatmap.\<identifier\>.function.\<identifier function\>.type | \<string\> | required [type of statistics](search_stats.html) | no |
The key is added to the response and may be used to distinguish between multiple functions, and should therefore be unique within the set of functions for each heatmap.
---
## Examples
1. [Basic](#basic) : basic facet on occurring part of speech
2. [Variable](#variable) : facets on occurring part of speech with variable
3. [Function](#function) : facet on occurring part of speech with function
---
<a name="basic"></a>
### Basic
**Example**
Heatmap for CQL query `[pos="N"]`.
**Request and response**
`q=*:*&wt=json&indent=true`
``` json
"mtas":{}
```
<a name="variable"></a>
### Variable
**Example**
Heatmap for CQL query `[pos=$1]` with `$1` equal to `N,ADJ`.
**Request and response**
`q=*:*&wt=json&indent=true`
``` json
"mtas":{}
```
<a name="function"></a>
### Function
**Example**
Heatmap for CQL query `[pos="N"]` with function.
**Request and response**
`q=*:*&wt=json&indent=true`
``` json
"mtas":{}
```
**Lucene**
To produce facets on metadata [directly in Lucene](installation_lucene.html), *ComponentHeatmap* together with the provided *collect* method can be used.
\ No newline at end of file
......@@ -45,6 +45,7 @@
<item name="Tokens" href="search_component_stats_tokens.html"/>
<item name="Spans" href="search_component_stats_spans.html"/>
</item>
<item name="Heatmap" href="search_component_heatmap.html"/>
<item name="Kwic" href="search_component_kwic.html"/>
<item name="List" href="search_component_list.html"/>
<item name="Page" href="search_component_page.html"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment