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

Allow defining search indexes as component attribute #36

Open
josephguillaume opened this issue Apr 16, 2024 · 1 comment
Open

Allow defining search indexes as component attribute #36

josephguillaume opened this issue Apr 16, 2024 · 1 comment

Comments

@josephguillaume
Copy link
Contributor

Currently, pos-navigation-bar only shows search when logged in, and only builds a global search index using indexes specified in a user's profile.

if (isLoggedIn) {
this.searchIndex = await this.os.buildSearchIndex(session.state.profile);

As a developer-user, in an app I might want to limit search to a specific set of resources, e.g. feed items/video titles, or individual photo captions. I don't necessarily want these in a global search index in other apps - given they can be many, they can "pollute" the search results.

I suggest the following interface:

<pos-navigation-bar search-indexes="./path/one/index.ttl ./path/two/index.ttl">

An alternative would be

<pos-navigation-bar search-profile="./path/to/custom/profile#this">

Where profile#this would have a label index predicate (though privateLabelIndex is probably not the right name). This would allow a larger set of search indices, but involves an additional layer of indirection.

This interface could also be public. This would allow search in a public wiki or issue tracker. The developer-user is responsible for ensuring the index files are available to public or only when logged in.

@angelo-v
Copy link
Contributor

I agree the search component could be generalized. Currently pos-navigation-bar is a very powerful global search and navigation component similar to a browsers address bar. This should not change, but a more generic pos-seach-bar with an interface similar to what you describe could be extracted and reused within pos-navigation-bar.

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

2 participants