-
Notifications
You must be signed in to change notification settings - Fork 12
/
sample.js
84 lines (79 loc) · 2.33 KB
/
sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
angular.module('sampleApp', ['ui.tree', 'ui.bootstrap']);
var SAMPLE_TYPE_MAPPING = {
"brewery": {
"enabled": true,
"properties": {
"name": {
"fields":[{"name":"name","type":"text","analyzer":"en"}],
"display_order": 2
},
"address": {
"enabled": true,
"properties": {
"city": {
"fields":[{"name":"city","type":"text"}]
}
},
"display_order": 1
}
},
"display_order":"10"
},
"beer":{
"enabled": true,
"properties": {
"name": {
"fields":[{"name":"name","type":"text"}]
}
},
"display_order":"5"
}
};
var SAMPLE_INDEX_MAPPING = {
"types": SAMPLE_TYPE_MAPPING,
"default_mapping": {
"enabled": true,
},
"type_field": "_type",
"default_type": "_default",
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"analysis": {
"analyzers": {},
"char_filters": {},
"tokenizers": {},
"token_filters": {},
"token_maps": {
"hw": {
"type": "custom",
"tokens": [
"hello",
"there"
]
}
}
}
};
angular.module('sampleApp').
controller('SampleCtrl', ['$scope', '$http', '$log', '$uibModal',
function($scope, $http, $log, $uibModal) {
var imc = initBleveIndexMappingController(
$scope, $http, $log, $uibModal,
SAMPLE_INDEX_MAPPING,
{
analyzerNames: null,
dateTypeParserNames: null
});
$scope.done = function() {
var im = imc.indexMapping();
console.log(im);
console.log(JSON.stringify(im));
}
}]);
angular.module('sampleApp').
controller('BleveAnalyzerModalCtrl', BleveAnalyzerModalCtrl).
controller('BleveCharFilterModalCtrl', BleveCharFilterModalCtrl).
controller('BleveTokenizerModalCtrl', BleveTokenizerModalCtrl).
controller('BleveTokenFilterModalCtrl', BleveTokenFilterModalCtrl).
controller('BleveWordListModalCtrl', BleveWordListModalCtrl);