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

Algolia search results can be visually indistinguishable from one another. #22

Open
mattstein opened this issue Feb 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@mattstein
Copy link
Contributor

mattstein commented Feb 9, 2021

Description

Algolia’s search results can include the page title only, which most of the time is a class name without its namespace. When classes with identical names but differing namespaces are listed as search results, it’s impossible to distinguish them from one another visually.

If you search for variant, as an example, the following classes will be in the results:

craft\commerce\gql\queries\Variant
craft\commerce\records\Variant
craft\commerce\gql\interfaces\elements\Variant
craft\commerce\gql\arguments\elements\Variant
craft\commerce\elements\db\VariantQuery
craft\commerce\elements\Variant
craft\commerce\gql\types\elements\Variant

Because only the page titles are listed in search results, those classes will basically be presented like this:

Variant
Variant
Variant
Variant
VariantQuery
Variant
Variant

A PR to index the full namespace+class rather than each page’s <h1> resulted in more specific results that were also much harder to read:

Screen Shot 2021-02-09 at 07 38 00 AM@2x

...so that was reverted.

Need to figure out a better way to differentiate results, whether that involves indexing configuration or customization of the Algolia DocSearch component.

Steps to reproduce

  1. Visit the latest Commerce docs.
  2. Search for keyword variant.
  3. Observe multiple results with identical “Variant” title, hovering over each to see unique links to different namespaces.
@mattstein mattstein added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Feb 9, 2021
@MattWilcox
Copy link

MattWilcox commented Nov 16, 2021

I have no experience at all with Algolia - but it is possible to adjust the listing so that if the left and right columns are the same, you just list one? That'd become a readable and useful list then?

@mattstein
Copy link
Contributor Author

Surely not impossible @MattWilcox, just a matter of customizing either the VuePress DocSearch component or re-indexing in some way that better differentiates results without creating a new problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants