* Add search methods * Add spec for new search methods * Add QueryBuilder for ClassifiedListing * Add QueryBuilder spec for ClassifiedListing * Refact build_query in ClassifiedListings * Refactor logic for filter and query conditions * Refactor index_documents to helper_method * Update elasticsearch helper for single objects * Refactor specs from stubbing to record update * Update search and specs for query_builder * Refactor set_size * Update Search::ClassifiedListing - Add DEFAULT_PAGE constant - ADD DEFAULT_PER_PAGE constant - Add pagination * Fix paging * Add pagination specs * Remove manual Array conversion for Array.wrap() * Change guard clause to .key? for readability
7 lines
219 B
Ruby
7 lines
219 B
Ruby
# Only included in specs with elasticsearch: true
|
|
module ElasticsearchHelpers
|
|
def index_documents(resources)
|
|
Array.wrap(resources).each(&:index_to_elasticsearch_inline)
|
|
described_class.refresh_index
|
|
end
|
|
end
|