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

Feature/Add search command #12

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Feature/Add search command #12

merged 1 commit into from
Oct 19, 2020

Conversation

Blokje5
Copy link
Contributor

@Blokje5 Blokje5 commented Oct 18, 2020

The search command allows the policy-hub-cli to search through a registry. It expects a path to a registry file containing the metadata + a search query. Then it constructs a bleve.Index if it did not exist, indexes the metadata and performs the search query.

The end result looks like this:
image

It is a bit of a prototype, so it definitely is not perfect. There are a few improvements we still need to do:

  • Structure the output, I just used the default bleve output
  • The code can probably be cleaned a bit, tests can be added as well
  • Ideally it works for multiple registries, right now I just index one

but it is a starting point

The search command allows the policy-hub-cli to search through a registry. It expects a path to a registry file containing the metadata + a search query. Then it constructs a bleve.Index if it did not exist, indexes the metadata and performs the search query.

Signed-off-by: Lennard Eijsackers <lennardeijsackers92@gmail.com>
@xchapter7x
Copy link
Contributor

Nice. I like it.
As we get a clearer view as to the UX and desired behaviors we can begin to add tests and things.

This is a great starting point to start designing the command set and user interactions.

👍

@xchapter7x xchapter7x merged commit e82b06b into main Oct 19, 2020
@xchapter7x xchapter7x deleted the feat/search-index branch October 19, 2020 15:39
@xchapter7x xchapter7x linked an issue Oct 26, 2020 that may be closed by this pull request
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.

Create a CLI command to search through repositories
2 participants