spec/units/search_spec.rb in es-elasticity-0.8.0 vs spec/units/search_spec.rb in es-elasticity-0.8.1
- old
+ new
@@ -106,10 +106,10 @@
docs = subject.documents(mapper)
expect(docs.aggregations).to eq aggregations
end
it "searches using scan&scroll" do
- expect(client).to receive(:search).with(index: index_name, type: document_type, body: body, search_type: "scan", size: 100, scroll: "1m").and_return(scan_response)
+ expect(client).to receive(:search).with(index: index_name, type: document_type, body: body, search_type: :query_then_fetch, size: 100, scroll: "1m").and_return(scan_response)
expect(client).to receive(:scroll).with(scroll_id: "abc123", scroll: "1m").and_return(scroll_response)
expect(client).to receive(:scroll).with(scroll_id: "abc456", scroll: "1m").and_return(empty_response)
docs = subject.scan_documents(mapper)
expected = [klass.new(_id: 1, name: "foo"), klass.new(_id: 2, name: "bar")]