Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove not analyzed #746

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ To define a multi field you have to specify any type except for `object` or `nes
```ruby
field :full_name, type: 'text', value: ->{ full_name.strip } do
field :ordered, analyzer: 'ordered'
field :untouched, index: 'not_analyzed'
field :untouched, type: 'keyword'
end
```

Expand Down
6 changes: 0 additions & 6 deletions lib/chewy/fields/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ def mappings_hash
mapping.reverse_merge!(options)
mapping.reverse_merge!(type: (children.present? ? 'object' : Chewy.default_field_type))

# This is done to support ES2 journaling and will be removed soon
if mapping[:type] == 'keyword' && Chewy::Runtime.version < '5.0'
mapping[:type] = 'string'
mapping[:index] = 'not_analyzed'
end

{name => mapping}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/chewy/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def self.by_index(index)
filter { match name: "Name#{index}" }
end

field :name, **KEYWORD_FIELD
field :name, type: 'keyword'
field :rating, type: :integer
end

define_type Country do
field :name, **KEYWORD_FIELD
field :name, type: 'keyword'
field :rating, type: :integer
end
end
Expand Down
7 changes: 0 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,8 @@
}
}

Chewy.default_field_type = 'string' if Chewy::Runtime.version < '5.0'
# Chewy.transport_logger = Logger.new(STDERR)

KEYWORD_FIELD = if Chewy::Runtime.version < '5.0'
{type: 'string', index: 'not_analyzed'}
else
{type: 'keyword'}
end

RSpec.configure do |config|
config.mock_with :rspec
config.order = :random
Expand Down