Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBIO: tweak search API #8

Merged
merged 3 commits into from
May 22, 2024

Conversation

RayPlante
Copy link
Collaborator

@RayPlante RayPlante commented May 6, 2024

The is PR is in response to a review of the feature/dbio-selected-ep branch which introduces advance query capabilities based around the MongoDB filter query syntax. In particular, it recommends the following changes:

  • change function name, select_constraint_records() to adv_select_records() for clarity
  • change signature for select_records() to allow for arbitrary keyword-value constraints to allow for future simple shortcut queries (e.g. author=Plante or keywords=forensics).
  • limit the available MongoDB operators via check_query_structure()

Unit tests have been updated to adapt to the API changes.

Please test in two ways

  • ensure that the unit tests pass; in this branch:
    1. run scripts/testall.pyunit (make sure MONGO_TESTDB_URL is not set)
    2. run the test_mongo.py script:
      1. Start the midas server stand-alone: scripts/midasserver -b -M
      2. set the MONGO_TESTDB_URL environment variable: export MONGO_TESTDB_URL=mongodb://oarop:oarop@localhost:27017/midas
      3. ensure your PYTHONPATH is properly set (export PYTHONPATH=$PWD/dist/pdr/lib/python) and dependencies are installed.
      4. run the test script: python python/tests/nistoar/midas/dbio/test_mongo.py
  • test under oar-docker:
    1. Check out the feature/dbio-mongo branch of oar-docker
    2. Change into the oar-docker/midas directory
    3. Build all components: ../scripts/localdeploy
    4. Build all containers: ../scripts/oarctl local build
    5. Launch application: ../scripts/oarctl local up
    6. Use portal to send advance queries to the DBIO service.

RayPlante added 2 commits May 6, 2024 15:47
  * select_constraint_records() => adv_select_records()
  * select_records(): allow for simple key=value constraints in signature
      for future simplified search syntax for important queries
  * update tests adjust to api tweaks
@RayPlante RayPlante requested a review from Iskander54 May 6, 2024 21:23
@Iskander54 Iskander54 merged commit fe53adb into feature/dbio-selected-ep May 22, 2024
2 checks passed
@RayPlante RayPlante deleted the feature/dbio-exp-search branch May 22, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants