Skip to content
Snippets Groups Projects
Commit d550409d authored by Gustavo S Frehse's avatar Gustavo S Frehse
Browse files

ISSUE #42: UPDATE Elasticsearch gem and mappings

parent 56061825
No related branches found
No related tags found
1 merge request!39ISSUE #42: UPDATE Elasticsearch gem and mappings
Pipeline #33867 failed
......@@ -179,6 +179,6 @@ gem 'acts_as_list'
gem 'faraday-net_http_persistent', '~> 2.0'
gem 'elasticsearch', '< 7.14'
gem 'elasticsearch', '~> 8.6'
......@@ -74,11 +74,9 @@ class Collection < ApplicationRecord
scope :from_user, ->(user) { where(owner: user) }
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author], callbacks: :async, index_prefix: Socket.gethostname.downcase, merge_mappings: true, mappings: {
collection: {
properties: {
created_at: {
type: "date"
}
"properties": {
"created_at": {
"type": "date"
}
}
}
......
......@@ -99,8 +99,13 @@ class LearningObject < ApplicationRecord
default_scope { includes(:object_type, :attachment, :attachments) }
scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) }
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type, :tags, :subjects, :educational_stages, :languages], callbacks: :async, index_prefix: Socket.gethostname.downcase, merge_mappings: true
{"mappings": {"_doc": {"properties": {"published_at": { "type": "date" }}}}}
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type, :tags, :subjects, :educational_stages, :languages], callbacks: :async, index_prefix: Socket.gethostname.downcase, merge_mappings: true, mappings: {
"properties": {
"published_at": {
"type": "date"
}
}
}
acts_as_paranoid
scope :search_import, -> { includes(:object_type, :tags, :subjects, :educational_stages, :publisher) }
......
......@@ -35,11 +35,11 @@ export PORTALMEC_DSPACE_PORT=8443
export PORTALMEC_DSPACE_HOST=mecdb4.c3sl.ufpr.br
### Elasticsearch credentials
export PORTALMEC_ELASTICSEARCH_LOGIN=portalmec
export PORTALMEC_ELASTICSEARCH_PASSWORD=elasticsearch
export PORTALMEC_ELASTICSEARCH_LOGIN=elastic
export PORTALMEC_ELASTICSEARCH_PASSWORD=123mudar
export PORTALMEC_ELASTICSEARCH_PORT=9200
#export PORTALMEC_ELASTICSEARCH_HOST=localhost
export PORTALMEC_ELASTICSEARCH_HOST=elasticsearchprod
export PORTALMEC_ELASTICSEARCH_HOST=localhost
#export PORTALMEC_ELASTICSEARCH_HOST=elasticsearchprod
### Cache
export MEMCACHE_SERVERS=localhost
......
......@@ -22,11 +22,15 @@ if Rails.env.production?
host = ENV['PORTALMEC_ELASTICSEARCH_HOST']
port = ENV['PORTALMEC_ELASTICSEARCH_PORT']
elasticsearch_client = Elasticsearch::Client.new(
url: host + ":" + port,
url: "https://" + login + ":" + pass + "@" + host + ":" + port,
transport_options: {
request: {
timeout: 550
}#,
},
ssl: {
verify: false
}
#,
#headers: {
# Authorization: "Basic " + Base64.strict_encode64(login + ":" + pass)
#}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment