|
Lines 148-157
sub get_elasticsearch_settings {
Link Here
|
| 148 |
tokenizer => 'standard', |
148 |
tokenizer => 'standard', |
| 149 |
filter => ['lowercase'], |
149 |
filter => ['lowercase'], |
| 150 |
}, |
150 |
}, |
| 151 |
default => { |
|
|
| 152 |
tokenizer => 'keyword', |
| 153 |
filter => ['lowercase'], |
| 154 |
}, |
| 155 |
}, |
151 |
}, |
| 156 |
} |
152 |
} |
| 157 |
} |
153 |
} |
|
Lines 176-184
sub get_elasticsearch_mappings {
Link Here
|
| 176 |
data => { |
172 |
data => { |
| 177 |
properties => { |
173 |
properties => { |
| 178 |
record => { |
174 |
record => { |
| 179 |
store => "yes", |
175 |
store => "true", |
| 180 |
include_in_all => JSON::false, |
176 |
include_in_all => JSON::false, |
| 181 |
type => "string", |
177 |
type => "text", |
| 182 |
}, |
178 |
}, |
| 183 |
} |
179 |
} |
| 184 |
} |
180 |
} |
|
Lines 189-195
sub get_elasticsearch_mappings {
Link Here
|
| 189 |
sub { |
185 |
sub { |
| 190 |
my ( $name, $type, $facet, $suggestible, $sort, $marc_type ) = @_; |
186 |
my ( $name, $type, $facet, $suggestible, $sort, $marc_type ) = @_; |
| 191 |
return if $marc_type ne $marcflavour; |
187 |
return if $marc_type ne $marcflavour; |
| 192 |
|
|
|
| 193 |
# TODO if this gets any sort of complexity to it, it should |
188 |
# TODO if this gets any sort of complexity to it, it should |
| 194 |
# be broken out into its own function. |
189 |
# be broken out into its own function. |
| 195 |
|
190 |
|
|
Lines 198-204
sub get_elasticsearch_mappings {
Link Here
|
| 198 |
my $es_type = |
193 |
my $es_type = |
| 199 |
$type eq 'boolean' |
194 |
$type eq 'boolean' |
| 200 |
? 'boolean' |
195 |
? 'boolean' |
| 201 |
: 'string'; |
196 |
: 'text'; |
| 202 |
|
197 |
|
| 203 |
if ($es_type eq 'boolean') { |
198 |
if ($es_type eq 'boolean') { |
| 204 |
$mappings->{data}{properties}{$name} = _elasticsearch_mapping_for_boolean( $name, $es_type, $facet, $suggestible, $sort, $marc_type ); |
199 |
$mappings->{data}{properties}{$name} = _elasticsearch_mapping_for_boolean( $name, $es_type, $facet, $suggestible, $sort, $marc_type ); |
|
Lines 209-216
sub get_elasticsearch_mappings {
Link Here
|
| 209 |
|
204 |
|
| 210 |
if ($facet) { |
205 |
if ($facet) { |
| 211 |
$mappings->{data}{properties}{ $name . '__facet' } = { |
206 |
$mappings->{data}{properties}{ $name . '__facet' } = { |
| 212 |
type => "string", |
207 |
type => "keyword", |
| 213 |
index => "not_analyzed", |
|
|
| 214 |
}; |
208 |
}; |
| 215 |
} |
209 |
} |
| 216 |
if ($suggestible) { |
210 |
if ($suggestible) { |
|
Lines 226-238
sub get_elasticsearch_mappings {
Link Here
|
| 226 |
$mappings->{data}{properties}{ $name . '__sort' } = { |
220 |
$mappings->{data}{properties}{ $name . '__sort' } = { |
| 227 |
search_analyzer => "analyser_phrase", |
221 |
search_analyzer => "analyser_phrase", |
| 228 |
analyzer => "analyser_phrase", |
222 |
analyzer => "analyser_phrase", |
| 229 |
type => "string", |
223 |
type => "text", |
| 230 |
include_in_all => JSON::false, |
224 |
include_in_all => JSON::false, |
| 231 |
fields => { |
225 |
fields => { |
| 232 |
phrase => { |
226 |
phrase => { |
| 233 |
search_analyzer => "analyser_phrase", |
227 |
search_analyzer => "analyser_phrase", |
| 234 |
analyzer => "analyser_phrase", |
228 |
analyzer => "analyser_phrase", |
| 235 |
type => "string", |
229 |
type => "text", |
| 236 |
}, |
230 |
}, |
| 237 |
}, |
231 |
}, |
| 238 |
}; |
232 |
}; |
|
Lines 272-282
sub _elasticsearch_mapping_for_default {
Link Here
|
| 272 |
phrase => { |
266 |
phrase => { |
| 273 |
search_analyzer => "analyser_phrase", |
267 |
search_analyzer => "analyser_phrase", |
| 274 |
analyzer => "analyser_phrase", |
268 |
analyzer => "analyser_phrase", |
| 275 |
type => "string", |
269 |
type => "text", |
| 276 |
}, |
270 |
}, |
| 277 |
raw => { |
271 |
raw => { |
| 278 |
type => "string", |
272 |
type => "keyword", |
| 279 |
index => "not_analyzed", |
|
|
| 280 |
} |
273 |
} |
| 281 |
}, |
274 |
}, |
| 282 |
}; |
275 |
}; |