Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
fixes #2, add stemming to all text fields in elasticsearch schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemartinez committed Mar 1, 2018
1 parent 7c71cb3 commit 3934061
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/models/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ class Text < ApplicationRecord

has_paper_trail

# apply stemming dynamically to all string/text fields
settings index: {} do
mapping dynamic_templates: [
{
strings: {
match_mapping_type: :string,
mapping: {
fields: {
keyword: {
type: "keyword",
ignore_above: 256
}
},
analyzer: :english
}
}
}
]
end


def as_indexed_json(options={})
as_json(
#only: [:title, :original, :journal_title, :publisher, :place_of_publication, :authors_name_from_source, :census_id],
Expand Down

0 comments on commit 3934061

Please sign in to comment.