Я уже сделал Comment.import
, и он вернул 0, что означает, что во время процесса импорта не было ошибок.elasticsearch-rails empty results
Я уже сделал Comment.__elasticsearch__.refresh_index!
Это модель я использую:
require "datamapper_adapter"
class Comment
include DataMapper::Resource
include Elasticsearch::Model
property :id, Serial
property :email, String
property :author, String
property :description, String
property :created_at, DateTime
belongs_to :picture
validates_presence_of :email, :author, :description
settings index: { number_of_shards: 1 } do
mappings dynamic: 'false' do
indexes :id, analyzer: 'english', index_options: 'offsets'
indexes :author, analyzer: 'english', index_options: 'offsets'
indexes :description, analyzer: 'english', index_options: 'offsets'
end
end
def as_indexed_json(options={})
as_json.except("picture_id", "created_at", "email", "_persistence_state", "_repository", "_id")
end
end
И еще все мои запросы к elasticsearch возвращает пустой массив как хиты.
curl -XPOST 'http://localhost:9200/comments/comment/_search?pretty
{
"took" : 35,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
У меня есть данные в моей БД, но я понятия не имею, почему он никогда не фильтруется. Любые идеи, почему это происходит? Это сводит меня с орехами
неНезависимо от того, что я делаю, ударяется ВСЕГДА пусто
У меня такая же проблема .. Вы решили? – JonatasTeixeira
Есть ли шанс увеличить уровень DEBUG, чтобы получить больше информации о том, что происходит во время импорта? – Val
Загрузите главу elasticsearch (http://mobz.github.io/elasticsearch-head/) и подключитесь к вашему экземпляру ES. Он содержит данные, которые вы ожидаете? – Codebeef