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

Inlcude regex and/or globbing in search query #46

Open
mthornba opened this issue May 3, 2017 · 4 comments
Open

Inlcude regex and/or globbing in search query #46

mthornba opened this issue May 3, 2017 · 4 comments

Comments

@mthornba
Copy link

mthornba commented May 3, 2017

Problem

The search query appears to only match entire words. Rarely-used commands are hard to find without knowing the complete word.

e.g. Finding an ssh option like PubkeyAuthentication in this command:
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]
I'd have to know the complete option name since searching for just Pubkey or Auth doesn't match the command I'm looking for:

$ bh Pubkey
$ bh Auth
cat auth
$ bh PubkeyAuthentication
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]

Desired behaviour

Option 1. Automatically match partial words

$ bh Pubkey
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]

Option 2. Require regex or globbing to match partial words

$ bh "Pubkey*"
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]

or

$ bh "\w*Auth\w*"
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected]
@rcaloras
Copy link
Owner

rcaloras commented May 3, 2017

@mthornba thanks for opening. You're correct. Bashhub's current text search implementation doesn't support partial words. From your example though, I may be able to configure it to index partial words based on CamelCase. e.g. Pubkey in PubkeyAuthentication.

I'll follow up with anything I can find. FYI I've also been debating moving search to be backed by elastic search which may provide partial words out of the box.

@mthornba
Copy link
Author

mthornba commented May 3, 2017

Thanks for the quick response! Not sure that the camelCase splitting would help me out in most cases, but I can usually find what I'm looking for in the interactive search.

elasticsearch does provide partial term searching including wildcard, regexp, and fuzzy matching but not sure what kind of additional load those types of queries may add on the server side.

@vik-y
Copy link

vik-y commented Dec 21, 2018

The backend still doesn't support partial text search. Are there any plans to migrate to elasticsearch?

@nicksherron
Copy link

Hey guys I recently started bashhub-server which is easy to use with bashhub-client and it adds support for regex to the bh command. Heres some examples.
@mthornba @vik-y

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

No branches or pull requests

4 participants