Lines 173-183
sub get_elasticsearch_mappings {
Link Here
|
173 |
# TODO cache in the object? |
173 |
# TODO cache in the object? |
174 |
my $mappings = { |
174 |
my $mappings = { |
175 |
data => { |
175 |
data => { |
176 |
_all => {type => "string", analyzer => "analyser_standard"}, |
|
|
177 |
properties => { |
176 |
properties => { |
178 |
record => { |
177 |
record => { |
179 |
store => "true", |
178 |
store => "true", |
180 |
include_in_all => JSON::false, |
|
|
181 |
type => "text", |
179 |
type => "text", |
182 |
}, |
180 |
}, |
183 |
} |
181 |
} |
Lines 226-232
sub get_elasticsearch_mappings {
Link Here
|
226 |
search_analyzer => "analyser_phrase", |
224 |
search_analyzer => "analyser_phrase", |
227 |
analyzer => "analyser_phrase", |
225 |
analyzer => "analyser_phrase", |
228 |
type => "text", |
226 |
type => "text", |
229 |
include_in_all => JSON::false, |
|
|
230 |
fields => { |
227 |
fields => { |
231 |
phrase => { |
228 |
phrase => { |
232 |
type => "keyword", |
229 |
type => "keyword", |
Lines 254-260
sub _elasticsearch_mapping_for_boolean {
Link Here
|
254 |
|
251 |
|
255 |
return { |
252 |
return { |
256 |
type => $type, |
253 |
type => $type, |
257 |
null_value => 0, |
254 |
null_value => 'false', |
258 |
}; |
255 |
}; |
259 |
} |
256 |
} |
260 |
|
257 |
|
Lines 344-350
sub get_fixer_rules {
Link Here
|
344 |
# boolean gets special handling, basically if it doesn't exist, |
341 |
# boolean gets special handling, basically if it doesn't exist, |
345 |
# it's added and set to false. Otherwise we can't query it. |
342 |
# it's added and set to false. Otherwise we can't query it. |
346 |
push @rules, |
343 |
push @rules, |
347 |
"unless exists('$name') add_field('$name', 0) end"; |
344 |
"unless exists('$name') add_field('$name', 'false') end"; |
|
|
345 |
push @rules, |
346 |
"if exists('$name') add_field('$name', 'true') end"; |
348 |
} |
347 |
} |
349 |
if ($type eq 'sum' ) { |
348 |
if ($type eq 'sum' ) { |
350 |
push @rules, "sum('$name')"; |
349 |
push @rules, "sum('$name')"; |