SkygearIO / skygear-doc

[Deprecated] Doc site generator for all the platform guides of Skygear; Content are here: https://github.com/SkygearIO/guides/tree/v1
https://docs.skygear.io/
MIT License
4 stars 19 forks source link

Site Searching #493

Closed ben181231 closed 7 years ago

ben181231 commented 7 years ago

Use Algolia

Design: desktop and mobile

ben181231 commented 7 years ago

This task is split from #462.

chpapa commented 7 years ago

Does the site searching support full text search? I just tried it seems only support keywords in subject / url?

e.g. I search "recordIDWithRecordType" and expect to come up with iOS Cloud Database Basics

ben181231 commented 7 years ago

Does the site searching support full text search?

Algolia supports full text search. It depends on what we upload for indexing. Currently, we only upload the url and the meta data of the guide document (including title, description).

It is okay to have a full text search when we upload all the document content to Algolia. But it does not fits the current UI. We may need another UI (something like highlighting the content being matched) when we need to show the result of the full text search.

chpapa commented 7 years ago

Maybe just have full text search first? (Need to update the deployment scripts to automate it)

For the UI, any simple way to show it?

Personally think it is not very useful if it is only search title and description... I guess it is not much different from a browser Ctrl-F

ben181231 commented 7 years ago

Maybe just have full text search first? (Need to update the deployment scripts to automate it)

Okay. I will update it.

Personally think it is not very useful if it is only search title and description... I guess it is not much different from a browser Ctrl-F.

The description is not shown in any UI currently. It is now use for the og:description meta tag and the site searching. So, it should be a little be different from the Ctrl-F.

For the UI, any simple way to show it?

I cannot come up with any good ideas.

ben181231 commented 7 years ago

Will give another PR for:

  1. Upload all guide document content for indexing
  2. Add a simple UI for matched content.
chpapa commented 7 years ago

@ben181231 3 feedbacks:

  1. One very minor thing -- I think the buttons on top right API Reference, Support and Search box, should appear in the Guide Index page too. (Actually, search box could be on top right in index page too?)
  2. Another problem: Is there any way we could make the code searchable? I think one of the most common use cases would be searching for the code.
  3. Is it easy for using the SDK, to highlight and jump to the page segment where the keywords was found after clicking the search result?
ben181231 commented 7 years ago

Oh... I miss this message.

One very minor thing -- I think the buttons on top right API Reference, Support and Search box, should appear in the Guide Index page too. (Actually, search box could be on top right in index page too?)

Okay. I will update it.

Another problem: Is there any way we could make the code searchable? I think one of the most common use cases would be searching for the code.

Currently, it is intended to remove all code blocks when uploading document content to Algolia for indexing. I have tried to mix the code and the document content. The outcome is not quite well since users will get more results on code block than the document content.

Is it easy for using the SDK, to highlight and jump to the page segment where the keywords was found after clicking the search result?

The search result is the raw content of the markdown files and the page content is HTML transform by markdown-it. It is quite difficult to link them back.

chpapa commented 7 years ago

Currently, it is intended to remove all code blocks when uploading document content to Algolia for indexing. I have tried to mix the code and the document content. The outcome is not quite well since users will get more results on code block than the document content.

Let's discuss it with Ten and see?

tensiuyan commented 7 years ago

I have looked into a few documentations, most of them search code blocks as well. If we're to search code blocks, to address Ben Lei's concern, we may need to fine tune the ranking formular to increase the search results' relevancy.

How about let's try it on staging and see if it is possible to fine tune the results?

There is actually another issue as well.

For example when I search "sign up", there will be 3 identical results but actually they are for different platforms. (see attachment) Plus by looking just the title and the description you won't know which one belongs to which platform.

screen shot 2017-04-07 at 4 30 58 pm

A few viable work arounds

  1. Use UI to indicate the platforms

    • Allow users to select the platform in the search box.
    • Results should have icons for users to navigate to the right platform (so you just need to display one platform)
  2. Use texts. (It assumes that users will enter the platform they are looking for in the search box i.e. signup android )

    • Indicate the platform in the title
    • Add tags to the platform and make it a factor in the ranking formular

Any idea?