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

OpenCypher singular search query #493

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

kmcginnes
Copy link
Collaborator

@kmcginnes kmcginnes commented Jul 16, 2024

Description

The openCypher version of the keyword search query would execute multiple parallel requests if the user has chosen "All" for the "Node Type" field, which is the default option.

Instead, we use a single query that contains all the node labels in the WHERE clause. Here's an example from the Airports database.

MATCH (v)
WHERE (v:`airport` OR v:`continent` OR v:`country` OR v:`version`)
RETURN v AS object
ORDER BY id(v)
LIMIT 10

I've also updated the query generation to better handle any of the search parameters that can be passed.

  • Add ability to handle multiple vertex types in a single request
  • Fix limit and offset query handling
  • Sort by ID for consistency
  • Better formatting of query strings
  • Improved testing

Validation

  • Test search with different parameters

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0
    license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

@kmcginnes kmcginnes marked this pull request as ready for review July 16, 2024 16:41
@kmcginnes kmcginnes mentioned this pull request Jul 16, 2024
5 tasks
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.

Project coverage is 15.07%. Comparing base (361c4ba) to head (f9c38cc).
Report is 60 commits behind head on main.

Files Patch % Lines
.../src/connector/openCypher/queries/keywordSearch.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #493      +/-   ##
==========================================
+ Coverage   13.97%   15.07%   +1.09%     
==========================================
  Files         414      420       +6     
  Lines       30639    30463     -176     
  Branches      878      978     +100     
==========================================
+ Hits         4283     4593     +310     
+ Misses      26026    25539     -487     
- Partials      330      331       +1     
Flag Coverage Δ
unittests 15.07% <98.14%> (+1.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@Cole-Greer Cole-Greer left a comment

Choose a reason for hiding this comment

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

Thanks Kris, LGTM.

@kmcginnes kmcginnes merged commit 50afdd9 into aws:main Jul 16, 2024
3 checks passed
@kmcginnes kmcginnes deleted the oc-search-query branch July 16, 2024 21:28
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