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

q= query with or does not work as expected #520

Closed
tloubrieu-jpl opened this issue Aug 2, 2024 · 4 comments
Closed

q= query with or does not work as expected #520

tloubrieu-jpl opened this issue Aug 2, 2024 · 4 comments
Assignees
Labels
B15.0 bug Something isn't working open.1.5.0 s.high High severity sprint-backlog

Comments

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Aug 2, 2024

Checked for duplicates

No - I haven't checked

🐛 Describe the bug

I tried to query my local pds registry with:

GET /products?q=((pds:Target_Identification.pds:name eq "Moon") or (cart:Geodetic_Model.cart:spheroid_name eq "MOON"))&limit=10000

And expected to see all labels with Moon target name or MOON spheroid name. However, I instead got no data at all. Each of these alone produced what I expected, ~1000 for target name and ~285 for spheroid name.

After adding the target name tags to the lola xml, I got back only the lola xml. So it seems like or is functioning as and.

🕵️ Expected behavior

I expected to get back around 1283 responses.

📜 To Reproduce

  1. Create treks and lola pds4 xml from the commands in the registry. Lola command is not merged, but on branch stac_utility

  2. load the xml files into the registry

  3. go to or curl http://localhost:8080/products?q=((pds:Target_Identification.pds:name eq "Moon") or (cart:Geodetic_Model.cart:spheroid_name eq "MOON"))&limit=10000

🖥 Environment Info

Version of this software stac_utility branch of registry
Operating System: Intel Macbook

🦄 Related requirements

TBD

@tloubrieu-jpl tloubrieu-jpl added B15.0 bug Something isn't working s.high High severity sprint-backlog labels Aug 2, 2024
@NASA-PDS NASA-PDS deleted a comment from mattanikiej Aug 2, 2024
@jordanpadams jordanpadams changed the title q query with or does not work as expected q= query with or does not work as expected Aug 2, 2024
@alexdunnjpl
Copy link
Contributor

alexdunnjpl commented Sep 6, 2024

@tloubrieu-jpl do you still have this environment set up? I was hoping you might be able to test with an up-to-date version of registry-api before I dive into trying to replicate - the following initial tests against the I&T database init indicate that OR/or is working as intended.

With two bundles, four collections:

http://localhost:8081/products?q=((product_class EQ "Product_Collection") or (product_class EQ "Product_Bundle")) returns 6

http://localhost:8081/products?q=((product_class EQ "Product_Collection") and (product_class EQ "Product_Bundle")) returns 0

@alexdunnjpl
Copy link
Contributor

Confirmed working as-expected on production API, too:

534 Bundle
1992 Collection
1992 Collection or Collection
1992 Collection OR Collection
2526 Bundle Or Collection

@alexdunnjpl
Copy link
Contributor

Running original query against prod registry/API

A - https://pds.mcp.nasa.gov/api/search/1/products?q=(pds:Target_Identification.pds:name eq "Moon") returns 2822398
B -https://pds.mcp.nasa.gov/api/search/1/products?q=(cart:Geodetic_Model.cart:spheroid_name eq "MOON") returns 288

A or B returns 2822398
A and B returns 288

So behaviour is as-expected

@alexdunnjpl
Copy link
Contributor

Closing as not-a-bug after confirming with @tloubrieu-jpl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B15.0 bug Something isn't working open.1.5.0 s.high High severity sprint-backlog
Projects
Status: 🏁 Done
Status: 🏁 Done
Development

No branches or pull requests

4 participants