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

Integrate with Algolia search #2

Open
jviotti opened this issue Feb 10, 2023 · 10 comments
Open

Integrate with Algolia search #2

jviotti opened this issue Feb 10, 2023 · 10 comments

Comments

@jviotti
Copy link
Member

jviotti commented Feb 10, 2023

No description provided.

@Era-cell
Copy link
Contributor

Era-cell commented Apr 27, 2024

Hi!! I think if the aim of the search will be to redirect to url just based on the keyword search.
we can implement it just using Javascript? - simple searching substrings method in JS.
-- with autocomplete and suggestions on best match
Also I tried algolia search, rn maybe I didn't find it that successful ... so, maybe I need to know the structure of the objects array on which we need to implement algolia search

@jviotti
Copy link
Member Author

jviotti commented Apr 29, 2024

Whatever works and gives us a good search experience. I saw many similar sites using Algolia, so that's why I suggested that, but maybe there are other options. Definitely worth doing some proper research.

On the JS approach, that'd work but I think it might be too simple. For example, you could search on the metadata of each keyword but not in the content explanations?

@jviotti
Copy link
Member Author

jviotti commented Apr 29, 2024

cc @RonItelman Are you aware of nice services to implement search capabilities on static sites?

@Era-cell
Copy link
Contributor

Era-cell commented Apr 29, 2024

Whatever works and gives us a good search experience. I saw many similar sites using Algolia, so that's why I suggested that, but maybe there are other options. Definitely worth doing some proper research.

On the JS approach, that'd work but I think it might be too simple. For example, you could search on the metadata of each keyword but not in the content explanations?

What I can get from this is we may need to store the description data again in JSON files, as algolia search works on JSON files...
Like keyword, description, title, etc, or find a way to use markdown files in the algolia search...

@jviotti
Copy link
Member Author

jviotti commented Apr 29, 2024

I was wondering if there is any search provider service that automatically scans/caches the live pages they would see at learnjsonschema.com to serve for their own search without us doing anything.

@Era-cell
Copy link
Contributor

Era-cell commented May 1, 2024

I was wondering if there is any search provider service that automatically scans/caches the live pages they would see at learnjsonschema.com to serve for their own search without us doing anything.

{noted} we can go with Algolia search as it is faster and is second best search as a service provider, elasticsearch is first but its for large databases..
So, for algolia search the input will be search word and json file in which we need to search for:
json structure I propose is:
{ "objectId": 1, "keyword": "$id", "url": "http://learnjsonschema.com/2020-12/core/id", "description": "This is what may be too long and I need help for " }
And other thing:
As many versions will be implemented what should be done in this:

  1. When the user is on base "http://learnjsonschema.com/2020-12/*" and searches keyword X, there will be ambiguity in whether 2019-09 or 2020-12 so should the search consider same version on which user is searching on?
  2. And if user types explicitely "2019 additionalProiperties".. like that then only we switch the version right? "http://learnjsonschema.com/2020-12

@jviotti
Copy link
Member Author

jviotti commented May 16, 2024

Yeah, I don't know how we could even generate those JSON documents. Probably worth a bit more research

@jviotti
Copy link
Member Author

jviotti commented May 16, 2024

This looks interesting: https://harrycresswell.com/writing/hugo-algolia/

@jviotti
Copy link
Member Author

jviotti commented May 16, 2024

There are also plenty of alternatives that work well with Hugo listed here: https://gohugo.io/tools/search/. Maybe some of them are much easier to work with

@jviotti
Copy link
Member Author

jviotti commented May 16, 2024

This one seems very local and easy: https://makewithhugo.com/add-search-to-a-hugo-site/ and here is a nice Hugo + Fuse.js template: https://github.com/zwbetz-gh/hugo-client-side-search-template

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