nasa / cmr-stac

Other
44 stars 21 forks source link

CMR-10163: Implement Free text search for collection search #352

Closed dmistry1 closed 2 days ago

dmistry1 commented 4 days ago

Overview

Adds support for free text search functionality for collection search. Users can now search for collections using a query parameter q in GET requests or as part of the JSON body in POST requests.

Key Changes

  1. Implemented free text search in the /collections endpoint
  2. Added support for the q parameter in both GET and POST requests
  3. Modified GraphQL query to include keyword search

Example Usage

GET request:

curl -X GET "http://localhost:3000/stac/PROVIDER/collections?q=MODIS" -H "Accept: application/json"

POST request:

curl -X POST "http://localhost:3000/stac/PROVIDER/collections" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{
           "q": "MODIS",
           "limit": 10
         }'

STAC browser: image

codecov-commenter commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.83%. Comparing base (70f1ca3) to head (22a24d5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #352 +/- ## ========================================== + Coverage 87.73% 87.83% +0.09% ========================================== Files 23 23 Lines 1109 1118 +9 Branches 238 241 +3 ========================================== + Hits 973 982 +9 Misses 136 136 ``` | [Flag](https://app.codecov.io/gh/nasa/cmr-stac/pull/352/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nasa) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/nasa/cmr-stac/pull/352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nasa) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nasa#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.