Skip to content

Commit 1a8424c

Browse files
committed
Add normalizing analizer to elasticsearch config
1 parent f7419c2 commit 1a8424c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

lib/blacklight/elasticsearch/repository.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ def seed_index docs
4242

4343
# TODO: move this to a yaml file
4444
connection.indices.create index:, body: {
45+
settings: {
46+
analysis: {
47+
analyzer: {
48+
foo: {
49+
type: "custom",
50+
tokenizer: "standard",
51+
filter: %w[
52+
lowercase
53+
asciifolding
54+
]
55+
}
56+
}
57+
}
58+
},
4559
mappings: {
4660
properties: {
4761
format: { type: 'keyword' },
@@ -51,7 +65,7 @@ def seed_index docs
5165
lc_1letter_ssim: { type: 'keyword' },
5266
subject_geo_ssim: { type: 'keyword' },
5367
subject_era_ssim: { type: 'keyword' },
54-
all_text_timv: { type: 'text' }
68+
all_text_timv: { type: 'text', analyzer: "foo", search_analyzer: "foo" }
5569
}
5670
}
5771
}

lib/blacklight/elasticsearch/request.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44

55
class Blacklight::Elasticsearch::Request < ActiveSupport::HashWithIndifferentAccess
66
# This is similar to qf in Solr
7-
cattr_accessor :query_fields, default: %w[ id
8-
full_title_tsim
9-
short_title_tsim
10-
alternative_title_tsim
11-
active_fedora_model_ssi
12-
title_tsim
13-
author_tsim
14-
subject_tsim
15-
all_text_timv]
7+
cattr_accessor :query_fields, default: %w[all_text_timv]
168
def initialize(constructor = {})
179
if constructor.is_a?(Hash)
1810
super()

0 commit comments

Comments
 (0)