File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ function buildDatetimeQuery(parameters) {
263263
264264function buildQuery ( parameters ) {
265265 const eq = 'eq'
266+ const inop = 'in'
266267 const { query, intersects } = parameters
267268 let must = [ ]
268269 if ( query ) {
@@ -278,6 +279,13 @@ function buildQuery(parameters) {
278279 }
279280 }
280281 accumulator . push ( termQuery )
282+ } else if ( operators . includes ( inop ) ) {
283+ const termsQuery = {
284+ terms : {
285+ [ `properties.${ property } ` ] : operatorsObject . in
286+ }
287+ }
288+ accumulator . push ( termsQuery )
281289 }
282290 const rangeQuery =
283291 buildRangeQuery ( property , operators , operatorsObject )
Original file line number Diff line number Diff line change @@ -222,3 +222,14 @@ test('stac/search fields filter', async (t) => {
222222 } , backend , endpoint )
223223 t . truthy ( response . features . length , 'Does not exclude required fields' )
224224} )
225+
226+ test ( 'stac/search in query' , async ( t ) => {
227+ const response = await search ( '/stac/search' , {
228+ query : {
229+ 'landsat:path' : {
230+ in : [ '10' ]
231+ }
232+ }
233+ } , backend , endpoint )
234+ t . is ( response . features . length , 3 )
235+ } )
You can’t perform that action at this time.
0 commit comments