Skip to content

Commit

Permalink
Remove not analyzed
Browse files Browse the repository at this point in the history
  • Loading branch information
konalegi committed Feb 2, 2021
1 parent 6e590ee commit 00664be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
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
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

0 comments on commit 00664be

Please sign in to comment.