Lines 173-185
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, |
179 |
copy_to => "_all_fields", |
181 |
type => "text", |
180 |
type => "text", |
182 |
}, |
181 |
}, |
|
|
182 |
_all_fields => { |
183 |
type => "text", |
184 |
analyzer => "analyser_standard" |
185 |
}, |
183 |
} |
186 |
} |
184 |
} |
187 |
} |
185 |
}; |
188 |
}; |
Lines 226-232
sub get_elasticsearch_mappings {
Link Here
|
226 |
search_analyzer => "analyser_phrase", |
229 |
search_analyzer => "analyser_phrase", |
227 |
analyzer => "analyser_phrase", |
230 |
analyzer => "analyser_phrase", |
228 |
type => "text", |
231 |
type => "text", |
229 |
include_in_all => JSON::false, |
232 |
copy_to => "_all_fields", |
230 |
fields => { |
233 |
fields => { |
231 |
phrase => { |
234 |
phrase => { |
232 |
type => "keyword", |
235 |
type => "keyword", |
Lines 254-260
sub _elasticsearch_mapping_for_boolean {
Link Here
|
254 |
|
257 |
|
255 |
return { |
258 |
return { |
256 |
type => $type, |
259 |
type => $type, |
257 |
null_value => 0, |
260 |
null_value => 'false', |
258 |
}; |
261 |
}; |
259 |
} |
262 |
} |
260 |
|
263 |
|
Lines 344-350
sub get_fixer_rules {
Link Here
|
344 |
# boolean gets special handling, basically if it doesn't exist, |
347 |
# boolean gets special handling, basically if it doesn't exist, |
345 |
# it's added and set to false. Otherwise we can't query it. |
348 |
# it's added and set to false. Otherwise we can't query it. |
346 |
push @rules, |
349 |
push @rules, |
347 |
"unless exists('$name') add_field('$name', 0) end"; |
350 |
"unless exists('$name') add_field('$name', 'false') end"; |
|
|
351 |
push @rules, |
352 |
"if exists('$name') add_field('$name', 'true') end"; |
348 |
} |
353 |
} |
349 |
if ($type eq 'sum' ) { |
354 |
if ($type eq 'sum' ) { |
350 |
push @rules, "sum('$name')"; |
355 |
push @rules, "sum('$name')"; |