Skip to content

Conversation

@al-niessner
Copy link
Contributor

@al-niessner al-niessner commented Oct 23, 2025

🗒️ Summary

Allows queries to collect documents based on the existence of a field.

⚙️ Test Data and/or Report

Do not know yet

♻️ Related Issues

Closes #406

pdsen-ci and others added 2 commits October 14, 2025 19:30
Updated the language to allow for finding documents that have a specific field name. If the FIELD is given, then it assumes that an exact match is being requested. If a STRINGVAL is given, then it treats it as a regular expression.

Processing regular expressions collects all of the known field names from the mapping and pulls out all matching field names. It then creates an existance check for each of the matching field names.
@al-niessner al-niessner self-assigned this Oct 23, 2025
@al-niessner al-niessner requested a review from a team as a code owner October 23, 2025 16:55
@al-niessner al-niessner marked this pull request as draft October 23, 2025 16:55
@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl

The branch test failed because of registry-loader. Really not part of these code changes...

Al Niessner added 5 commits October 29, 2025 08:56
Use the functionality in ProductsController to collect the property mappings. Use the names in mappings to then find the set of matches for the exists.
@al-niessner
Copy link
Contributor Author

@jordanpadams @tloubrieu-jpl

Let me know about the bomb out. If you want it then I will add the statement to do it. Otherwise it is ready; meaning it fails silently from the end users perspective.

@al-niessner al-niessner marked this pull request as ready for review October 29, 2025 17:09
@jordanpadams
Copy link
Member

jordanpadams commented Oct 31, 2025

@al-niessner per my comment on the issue, let's return an error if something isn't as expected unless @tloubrieu-jpl has other ideas.

@jordanpadams
Copy link
Member

@al-niessner can we had a 2+ regression tests to the postman suite to support this?

Copy link
Member

@jordanpadams jordanpadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comments for error handling and tests needed

@jordanpadams jordanpadams requested a review from Copilot October 31, 2025 13:43
@jordanpadams jordanpadams changed the title Issue 406: existence checking Add API support for checking if a search field exists in a result (e.g. not null) Oct 31, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements field existence checking functionality for queries, allowing users to search for documents based on whether a field exists. The changes include grammar updates to support an exists operator, modifications to the search listener to handle existence queries, and various code quality improvements including better logging patterns and test refinements.

Key changes:

  • Added grammar support for existence queries in the search language
  • Implemented existence checking logic with support for both direct field names and regex patterns
  • Refactored code to improve logging practices and remove unused imports

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Search.g4 Added EXISTS token and existence rule to grammar for field existence queries
Antlr4SearchListener.java Implemented exitExistence method to handle existence queries, added ConnectionContext dependency, improved logging
ProductsController.java Made productPropertiesList method static to support existence checking, improved logging patterns
RegistrySearchRequestBuilder.java Changed parseQueryString to instance method, improved logging with parameterized messages, removed unused imports
Antlr4SearchListenerTest.java Updated tests to pass ConnectionContext parameter, improved assertion patterns, changed visibility modifiers
TestParsing.java Added stub methods for existence context handling, improved assertion order in tests
CHANGELOG.md Updated version and changelog entries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

al-niessner and others added 3 commits November 3, 2025 08:48
…archListener.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…lr4SearchListenerTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@al-niessner
Copy link
Contributor Author

@al-niessner can we had a 2+ regression tests to the postman suite to support this?

@jordanpadams @tloubrieu-jpl how?

@jordanpadams
Copy link
Member

@al-niessner just created some documentation for this here: NASA-PDS/registry#445

I will also email the internal wiki page.

Al Niessner added 2 commits November 13, 2025 08:07
Added various tests for specific names and wildcards. Both exists and not exists. Flushed out some bugs and fixed them.
@sonarqubecloud
Copy link

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.

As a user, I want to query for documents where a specific search field exists in the document

4 participants