File tree Expand file tree Collapse file tree 1 file changed +0
-54
lines changed Expand file tree Collapse file tree 1 file changed +0
-54
lines changed Original file line number Diff line number Diff line change @@ -328,58 +328,4 @@ def bool_query(obj)
328328 expect ( s . to_hash ) . to eq ( expected_hash )
329329 end
330330 end
331-
332- describe '#collapse' do
333-
334- let ( :s ) do
335- search do
336- query do
337- match title : 'test'
338- end
339- collapse :user do
340- max_concurrent_group_searches 4
341- inner_hits 'last_tweet' do
342- size 10
343- from 5
344- sort do
345- by :date , order : 'desc'
346- by :likes , order : 'asc'
347- end
348- end
349- end
350- end
351- end
352-
353- let ( :inner_hits_hash ) do
354- { name : 'last_tweet' ,
355- size : 10 ,
356- from : 5 ,
357- sort : [ { date : { order : 'desc' } } ,
358- { likes : { order : 'asc' } } ]
359- }
360- end
361-
362- let ( :expected_hash ) do
363- { query : { match : { title : 'test' } } ,
364- collapse : { field : :user ,
365- max_concurrent_group_searches : 4 ,
366- inner_hits : inner_hits_hash } }
367- end
368-
369- it 'sets the field name' do
370- expect ( s . to_hash [ :collapse ] [ :field ] ) . to eq ( :user )
371- end
372-
373- it 'sets the max_concurrent_group_searches option' do
374- expect ( s . to_hash [ :collapse ] [ :max_concurrent_group_searches ] ) . to eq ( 4 )
375- end
376-
377- it 'sets the inner_hits' do
378- expect ( s . to_hash [ :collapse ] [ :inner_hits ] ) . to eq ( inner_hits_hash )
379- end
380-
381- it 'constructs the correct hash' do
382- expect ( s . to_hash ) . to eq ( expected_hash )
383- end
384- end
385331end
You can’t perform that action at this time.
0 commit comments