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

Replace direct id-based search with a query for the id #11370

Closed
wants to merge 3 commits into from

Conversation

whatisgalen
Copy link
Member

@whatisgalen whatisgalen commented Aug 20, 2024

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Replaces instances of...

result = search_engine.search(index=CONCEPTS_INDEX, id=some_id)

with

query = Query(se=se, start=0, limit=100)
bool_query = Bool()
bool_query.filter(Term(field="id", term=some_id)) # or whichever id-field is needed
query.add_query(bool_query)
results = query.search(index=CONCEPTS_INDEX)

Issues Solved

Closes #11360

Checklist

  • I targeted one of these branches:
    • dev/7.6.x (under development): features, bugfixes not covered below
    • dev/7.5.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/6.2.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Ticket Background

Further comments

@whatisgalen whatisgalen linked an issue Aug 20, 2024 that may be closed by this pull request
@whatisgalen whatisgalen changed the title 11360 ids q Replace direct id-based search with a query for the id Aug 20, 2024
@whatisgalen
Copy link
Member Author

Note that the build_target_branch tests failing get fixed by the change on this branch

@chiatt
Copy link
Member

chiatt commented Aug 21, 2024

@apeters Identified that the failing tests were caused by the fact that there were unindexed concepts and fixed the testing issue here: #11375. The change may have actually masked that issue, so I think it makes sense not to change these methods. At most perhaps some error handling and logging of the error might be helpful.

@whatisgalen
Copy link
Member Author

closing in favor of #11383

@whatisgalen whatisgalen deleted the 11360_ids_q branch August 21, 2024 18:33
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.

es.se.search(id= queries raise an exception if id doesn't exist
3 participants