2013-08-28 19:24:34 -04:00
|
|
|
[[modules]]
|
|
|
|
= Modules
|
|
|
|
|
|
|
|
include::modules/cluster.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/discovery.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/gateway.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/http.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/indices.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/memcached.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/network.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/node.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/plugins.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/scripting.asciidoc[]
|
|
|
|
|
make term statistics accessible in scripts
term statistics can be accessed via the _shard variable.
Below is a minimal example. See documentation on details.
```
DELETE paytest
PUT paytest
{
"mappings": {
"test": {
"_all": {
"auto_boost": true,
"enabled": true
},
"properties": {
"text": {
"index_analyzer": "fulltext_analyzer",
"store": "yes",
"type": "string"
}
}
}
},
"settings": {
"analysis": {
"analyzer": {
"fulltext_analyzer": {
"filter": [
"my_delimited_payload_filter"
],
"tokenizer": "whitespace",
"type": "custom"
}
},
"filter": {
"my_delimited_payload_filter": {
"delimiter": "+",
"encoding": "float",
"type": "delimited_payload_filter"
}
}
},
"index": {
"number_of_replicas": 0,
"number_of_shards": 1
}
}
}
POST paytest/test/1
{
"text": "the+1 quick+2 brown+3 fox+4 is quick+10"
}
POST paytest/test/2
{
"text": "the+1 quick+2 red+3 fox+4"
}
POST paytest/_refresh
POST paytest/_search
{
"script_fields": {
"ttf": {
"script": "_shard[\"text\"][\"quick\"].ttf()"
}
}
}
POST paytest/_search
{
"script_fields": {
"freq": {
"script": "_shard[\"text\"][\"quick\"].freq()"
}
}
}
POST paytest/test/2/_termvector
POST paytest/_search
{
"script_fields": {
"payloads": {
"script": "term = _shard[\"text\"].get(\"red\",_PAYLOADS);payloads = []; for(pos : term){payloads.add(pos.payloadAsFloat(-1));} return payloads;"
}
}
}
POST paytest/_search
{
"script_fields": {
"tv": {
"script": "_shard[\"text\"][\"quick\"].freq()"
}
},
"query": {
"function_score": {
"functions": [
{
"script_score": {
"script": "_shard[\"text\"][\"quick\"].freq()"
}
}
]
}
}
}
```
closes #3772
2014-01-02 05:17:33 -05:00
|
|
|
include::modules/advanced-scripting.asciidoc[]
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
include::modules/threadpool.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/thrift.asciidoc[]
|
|
|
|
|
|
|
|
include::modules/transport.asciidoc[]
|
|
|
|
|
2013-11-08 19:20:43 -05:00
|
|
|
include::modules/snapshots.asciidoc[]
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
|