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

Full shelfmark search for multiple shelfmarks not working in admin #1498

Closed
kseniaryzhova opened this issue Dec 4, 2023 · 5 comments
Closed
Assignees
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant
Milestone

Comments

@kseniaryzhova
Copy link

Describe the bug
Entering more than one shelfmark into the admin search gives 0 results (even if both shelfmarks are confirmed to be in the database). This means we can't search by shelfmarks to form joins. Inputting the one shelfmark into the other's description will also only pull up one result in the shelfmark search, and not the second shelfmark.

To reproduce
Steps to reproduce the behavior:

  1. Go to document search in admin
  2. Search for any two shelfmarks using AND or OR (ex: T-S 10J16.13 OR T-S 10J16.14)
  3. See error.
  4. Please note that if you search for any of the shelfmarks alone (T-S 10J16.13 for example) it will pop up correctly.

Expected behavior
I should be able to enter more than one shelfmark at a time into the admin document search bar and receive the correct search results.

Device information
Malfunctioning on both PC and Mac devices.

@kseniaryzhova kseniaryzhova added the 🐛 bug Something isn't working label Dec 4, 2023
@blms blms added the performant Tasks for or taken on by Performant label Jan 4, 2024
@richmanrachel richmanrachel added this to the Search milestone Feb 6, 2024
@blms
Copy link
Contributor

blms commented Feb 8, 2024

@kseniaryzhova Testing to figure this out, it seems it may be because the OR operator only works between the two words that you place it between. In other words:

T-S 10J16.13 OR T-S 10J16.14

gets parsed as

T-S (10J16.13 OR T-S) 10J16.14

and since the default operator is AND when unspecified, that fully evaluates to:

T-S AND (10J16.13 OR T-S) AND 10J16.14
= T-S AND (T-S) AND 10J16.14
= T-S AND 10J16.14

That's why you're getting unexpected results; all this is really saying is "search for all documents with T-S and 10J16.14".

In that case, the correctly formed query would be:

T-S (10J16.13 OR 10J16.14)

which does result in the two expected results, plus the one that mentions one in the description.

OK to close since that seems to bring up the expected results?

@blms blms added the ❓ question Further information is requested label Feb 9, 2024
@blms blms self-assigned this Feb 13, 2024
@kseniaryzhova
Copy link
Author

@blms Not closing because this solution only works for two T-S shelfmarks, but not if it's shelfmarks from more than one collection.
image

@kseniaryzhova
Copy link
Author

And if you need both shelfmarks for a join and it's in different collections, then you still can't bring both together to merge them in admin.

@blms
Copy link
Contributor

blms commented Feb 27, 2024

@kseniaryzhova I would write that query as (T-S 10J16.13) OR (BL OR 10656.16):
https://geniza.princeton.edu/admin/corpus/document/?q=%28T-S+10J16.13%29+OR+%28BL+OR+10656.16%29

And if you need both shelfmarks for a join and it's in different collections, then you still can't bring both together to merge them in admin.

Does the (shelfmark) OR (shelfmark) format cover that case? Or if not, can you give an example?

@kseniaryzhova
Copy link
Author

@blms no it does cover it, ok! I'll let Marina know! Closing!

@blms blms removed the ❓ question Further information is requested label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working performant Tasks for or taken on by Performant
Projects
None yet
Development

No branches or pull requests

3 participants