Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
add _termvectors autocomplete
Browse files Browse the repository at this point in the history
Closes #27
  • Loading branch information
imotov authored and bleskes committed Sep 21, 2015
1 parent 0d3461c commit 5fd93e6
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 2 deletions.
77 changes: 75 additions & 2 deletions public/api_server/es_1_0/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* from Elasticsearch Incorporated.
*/



'use strict';

module.exports = function (api) {
Expand Down Expand Up @@ -162,5 +160,80 @@ module.exports = function (api) {
}
});

api.addEndpointDescription('_termvectors', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/_termvectors"
],
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": ""
},
data_autocomplete_rules: {
fields: [
"{field}"
],
"offsets": {__one_of: [false, true]},
"payloads": {__one_of: [false, true]},
"positions": {__one_of: [false, true]},
"term_statistics": {__one_of: [true, false]},
"field_statistics": {__one_of: [false, true]},
"per_field_analyzer": {
__template: {"FIELD": ""},
"{field}": ""
},
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"doc": {}
}
});

api.addEndpointDescription('_termvectors_id', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/{id}/_termvectors"
],
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": ""
},
data_autocomplete_rules: {
fields: [
"{field}"
],
"offsets": {__one_of: [false, true]},
"payloads": {__one_of: [false, true]},
"positions": {__one_of: [false, true]},
"term_statistics": {__one_of: [true, false]},
"field_statistics": {__one_of: [false, true]},
"dfs": {__one_of: [true, false]},
"per_field_analyzer": {
__template: {"FIELD": ""},
"{field}": ""
},
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"]
}
});

};
97 changes: 97 additions & 0 deletions public/api_server/es_2_0/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,101 @@ module.exports = function (api) {
"script": ""
}
});

api.addEndpointDescription('_termvectors', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/_termvectors"
],
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": "",
"dfs": "__flag__"
},
data_autocomplete_rules: {
fields: [
"{field}"
],
"offsets": {__one_of: [false, true]},
"payloads": {__one_of: [false, true]},
"positions": {__one_of: [false, true]},
"term_statistics": {__one_of: [true, false]},
"field_statistics": {__one_of: [false, true]},
"dfs": {__one_of: [true, false]},
"per_field_analyzer": {
__template: {"FIELD": ""},
"{field}": ""
},
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"doc": {},
"filter": { // TODO: Exclude from global filter rules
"max_num_terms": 1,
"min_term_freq": 1,
"max_term_freq": 1,
"min_doc_freq": 1,
"max_doc_freq": 1,
"min_word_length": 1,
"max_word_length": 1
}
}
});
+
api.addEndpointDescription('_termvectors_id', {
methods: ['GET', 'POST'],
patterns: [
"{index}/{type}/{id}/_termvectors"
],
url_params: {
"fields": "",
"offsets": "__flag__",
"payloads": "__flag__",
"positions": "__flag__",
"term_statistics": "__flag__",
"field_statistics": "__flag__",
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"parent": "",
"preference": "",
"dfs": "__flag__"
},
data_autocomplete_rules: {
fields: [
"{field}"
],
"offsets": {__one_of: [false, true]},
"payloads": {__one_of: [false, true]},
"positions": {__one_of: [false, true]},
"term_statistics": {__one_of: [true, false]},
"field_statistics": {__one_of: [false, true]},
"dfs": {__one_of: [true, false]},
"per_field_analyzer": {
__template: {"FIELD": ""},
"{field}": ""
},
"routing": "",
"version": 1,
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
"filter": { // TODO: Exclude from global filter rules
"max_num_terms": 1,
"min_term_freq": 1,
"max_term_freq": 1,
"min_doc_freq": 1,
"max_doc_freq": 1,
"min_word_length": 1,
"max_word_length": 1
}
}
});
};

0 comments on commit 5fd93e6

Please sign in to comment.