0
我有一個user
模型,它有一個articles
對象的數組。當我嘗試使用ID
加載用戶時,該過程需要很長時間,因爲它可能會有數千個數組中的項目對象。我想要做的只是加載100個嵌套文章。我使用Elasticsearch 1.5
(舊,因爲它是在AWS託管),ES Persistence gem
和Ruby on Rails
Elasticsearch限制返回的嵌套對象的數量
嘗試了一些文件,但沒有工作,例如 https://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-aggregations-bucket-nested-aggregation.html
class User
include Elasticsearch::Persistence::Model
attribute :articles, Array[MiniArticle], mapping: { type: 'nested'}
attribute :since_id
end
您需要更多信息? – Val
感謝@Val有沒有使用PR的工作?正如我所提到的,我在AWS –
上使用版本1.5,恐怕不行。 – Val