@@ -24,14 +24,14 @@ import { connection } from '../../utils'
2424test ( 'Search should have an additional documents property' , async t => {
2525 const MockConnection = connection . buildMockConnection ( {
2626 onRequest ( params ) {
27- t . equal ( params . querystring , 'filter_path=hits.hits._source' )
27+ t . equal ( params . querystring , 'filter_path=hits.hits._id%2Chits.hits. _source' )
2828 return {
2929 body : {
3030 hits : {
3131 hits : [
32- { _source : { one : 'one' } } ,
33- { _source : { two : 'two' } } ,
34- { _source : { three : 'three' } }
32+ { _id : '1' , _source : { one : 'one' } } ,
33+ { _id : '2' , _source : { two : 'two' } } ,
34+ { _id : '3' , _source : { three : 'three' } }
3535 ]
3636 }
3737 }
@@ -49,16 +49,16 @@ test('Search should have an additional documents property', async t => {
4949 query : { match_all : { } }
5050 } )
5151 t . same ( result , [
52- { one : 'one' } ,
53- { two : 'two' } ,
54- { three : 'three' }
52+ { _id : '1' , one : 'one' } ,
53+ { _id : '2' , two : 'two' } ,
54+ { _id : '3' , three : 'three' }
5555 ] )
5656} )
5757
5858test ( 'kGetHits fallback' , async t => {
5959 const MockConnection = connection . buildMockConnection ( {
6060 onRequest ( params ) {
61- t . equal ( params . querystring , 'filter_path=hits.hits._source' )
61+ t . equal ( params . querystring , 'filter_path=hits.hits._id%2Chits.hits. _source' )
6262 return { body : { } }
6363 }
6464 } )
@@ -78,14 +78,14 @@ test('kGetHits fallback', async t => {
7878test ( 'Merge filter paths (snake_case)' , async t => {
7979 const MockConnection = connection . buildMockConnection ( {
8080 onRequest ( params ) {
81- t . equal ( params . querystring , 'filter_path=foo%2Chits.hits._source' )
81+ t . equal ( params . querystring , 'filter_path=foo%2Chits.hits._id%2Chits.hits. _source' )
8282 return {
8383 body : {
8484 hits : {
8585 hits : [
86- { _source : { one : 'one' } } ,
87- { _source : { two : 'two' } } ,
88- { _source : { three : 'three' } }
86+ { _id : '1' , _source : { one : 'one' } } ,
87+ { _id : '2' , _source : { two : 'two' } } ,
88+ { _id : '3' , _source : { three : 'three' } }
8989 ]
9090 }
9191 }
@@ -104,9 +104,9 @@ test('Merge filter paths (snake_case)', async t => {
104104 query : { match_all : { } }
105105 } )
106106 t . same ( result , [
107- { one : 'one' } ,
108- { two : 'two' } ,
109- { three : 'three' }
107+ { _id : '1' , one : 'one' } ,
108+ { _id : '2' , two : 'two' } ,
109+ { _id : '3' , three : 'three' }
110110 ] )
111111} )
112112
0 commit comments