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

[RFC] Search experience for new product spaces #31253

Closed
siriwatknp opened this issue Mar 1, 2022 · 13 comments · Fixed by #31811
Closed

[RFC] Search experience for new product spaces #31253

siriwatknp opened this issue Mar 1, 2022 · 13 comments · Fixed by #31811
Labels
discussion docs Improvements or additions to the documentation

Comments

@siriwatknp
Copy link
Member

siriwatknp commented Mar 1, 2022

Why?

We are about to have more than 1 space in the docs that can have similar headings. If we don't do anything, the search result will show a list of the same name (with different URL), for example:

By searching "Button", we might see

  • Button (/material-ui/react-button/)
  • Button (/joy-ui/react-button/)
  • Button Unstyled (/base/react-button-unstyled/)

Goal

build a good-enough search experience for new spaces so that we can make them live as soon as possible

Requirement

  • search result should be ranked as the most related content
  • search result should show some differences for the same title

Proposal

The first step I think is to rank the product space based on the user’s URL.



Product space ranking

Scenario 1: on homepage
When they search for “tutorial”, there is no ranking so the search result is ranked based on the object ID (default by algolia).

Scenario 2: inside a product space
If they are in material-ui space (/material-ui/*), when they search anything the result of the material-ui space should be ranked first.

Product space indicator

It is possible that the search result will show the same title like:

search for “Button”:

  • Button (/material-ui/react-button/)
  • Button (/joy-ui/react-button/)
  • Toggle Button (/material-ui/react-button/)
  • Toggle Button (/joy-ui/react-button/)

To make it obvious, there should be a product identifier (like a badge after the title)

image

Product exclusion

This one is optional if we found out it is needed. Basically for the case where developers are in material-ui space should not see the search result from another design system (joy-ui).

cc @mui/core @danilo-leal @samuelsycamore

@siriwatknp siriwatknp added docs Improvements or additions to the documentation discussion labels Mar 1, 2022
@danilo-leal
Copy link
Contributor

This one is optional if we found out it is needed. Basically for the case where developers are in material-ui space should not see the search result from another design system (joy-ui).

This came to my mind... Wouldn't make more sense to display results only regarding the product I'm currently looking at? I feel like preparing the search to display results across all MUI (company-wide) documentation is assuming that users are interested/actively "cross-using" the products - which could be something we wish and want - but maybe is lacking evidence?! Not sure. I guess I'd consider initially this scenario "product exclusion" first rather than the global search.

@mnajdova
Copy link
Member

mnajdova commented Mar 2, 2022

Priority + badge for the package makes most sense to me too. I think it's risky to completely not display result data for other products.

@michaldudak
Copy link
Member

Wouldn't make more sense to display results only regarding the product I'm currently looking at?

I agree that focusing search results on the product we're looking at makes sense. It creates a clear separation of products. However, not displaying other results could potentially prevent some of the users from finding out about our other products. We could hide additional results under a collapsed region (using a progressive disclosure pattern) with a header saying "Other MUI products", or something along these lines.

@danilo-leal
Copy link
Contributor

It could work but I think I'd prioritize developer experience instead of trying to optimize for a bit of cross-selling. Given search is a heavy-used feature, it could become eventually annoying having to deal with results that are not really relevant if I'm a strict Base/Joy/one-product-only user. We could (and should) mention them when appropriate (or complementary) to a given component/problem in specific.

@michaldudak
Copy link
Member

I may have not made it clear, then - I'm for prioritizing the results that belong to the space we're in. So, someone on the Base space is searching for button, they would get:

  • ButtonUnstyled
  • useButton
  • > results from other MUI products

and only when they decide to expand other results, they could see Material UI Button and Joy Button, etc.

@danilo-leal
Copy link
Contributor

That could work! Might as well iterate on this and see how it feels.
@siriwatknp Any thoughts?

@siriwatknp
Copy link
Member Author

siriwatknp commented Mar 7, 2022

That could work! Might as well iterate on this and see how it feels. @siriwatknp Any thoughts?

Yep, I think let's try the first step which is to display all related results and see how it feels (the result at the top will be the product space that the user is located at).

@siriwatknp
Copy link
Member Author

siriwatknp commented Mar 9, 2022

Result

According to Algolia doc, the best candidate approach is to use optionalFilters. It helps us ranking the specify product to the top, here is the result.

Attempt 1: Without optionalFilters

Screen Shot 2565-03-09 at 08 52 20

Button (Material UI & Joy) has the same ranking score so it is ordered based on objectID (the index time).

Attempt 2: With optionalFilters: $product

For example, if you are in /joy-ui/*, the product is joy-ui which match all the pages under /joy-ui/*

Joy Base Material
Screen Shot 2565-03-09 at 08 55 50 Screen Shot 2565-03-09 at 08 57 14 Screen Shot 2565-03-09 at 09 08 32

It is likely that the results contain only the product space search. I think it would be nice for material-ui and joy-ui to display base as well.

Attempt 3: Prepend base as extra optionalFilters

For example, if you are in /joy-ui/* the optionalFilters will be ['product:joy-ui', 'product:base']

Joy Material
Screen Shot 2565-03-09 at 09 13 15 Screen Shot 2565-03-09 at 09 12 47

Note: if base has the same h1, there might be a wierd result like this which the results are grouped by docsearch library (not algolia):

Screen Shot 2565-03-09 at 09 26 11

I think all base components should prepend with unstyled.

cc @danilo-leal @michaldudak

@danilo-leal
Copy link
Contributor

danilo-leal commented Mar 9, 2022

The best option for me is the 2nd one (thanks for showing us these though!). I'm not entirely sure we should display Base components on the search result, for either Material and Joy. The cmd+K search to me is all about speed, if folks want to dig deeper into the component build, we should for sure reference that they are built on top of Base and then link its respective Base API on that component page. I could be entirely wrong though... just my assumption!

I guess I wouldn't be surprised at all if option 1 worked just as fine! We'd only need to tweak the UI a bit.

@siriwatknp
Copy link
Member Author

siriwatknp commented Mar 9, 2022

I guess I wouldn't be surprised at all if option 1 worked just as fine!

For me, option 1 would not work. Imagine you are in /joy-ui/* and then you search for "autocomplete" and you got material-ui as the first result, that's 99% not what the developer would like to see. So either 2, or 3 sounds good to me (more of 3 because it increases a chance for the base to be discovered which developers can use it along side with material-ui or joy-ui).

We'd only need to tweak the UI a bit

For sure, currently, we need 3 colors to separate between material-ui, base, and joy-ui. Do you want to work on this? or you could just pick the color and I'll add to it.

@danilo-leal
Copy link
Contributor

Oh, ok! Makes sense. So, between 2 and 3, I lean towards more to the second option. I'd want to wait more opinions here before dive deeper into the UI change it would need to happen 😅

@siriwatknp
Copy link
Member Author

@oliviertassinari what's your thought about this topic?

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 14, 2022

@siriwatknp 👍 for option 2. Why? Because 1 would create too much noise (need to filter the list) and because 3 could create product confusion (the same component in two different products that behaves differently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants