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

docs(createQuerySuggestionsPlugin): rewrite docs #468

Merged
merged 6 commits into from
Mar 4, 2021

Conversation

sarahdayan
Copy link
Member

This rewrites the createQuerySuggestionsPlugin docs.

@sarahdayan
Copy link
Member Author

Broken unit tests are caused by 752afd8 which broke the build.

@francoischalifour
Copy link
Member

There are additional params since the doc creation:

/**
* The attribute or attribute path to display categories.
* @example ["instant_search", "facets", "exact_matches", "categories"]
* @example ["instant_search", "facets", "exact_matches", "hierarchicalCategories.lvl0"]
*/
categoryAttribute?: string | string[];
/**
* The number of items to display categories for.
* @default 1
*/
categoriesLimit?: number;
/**
* The number of categories to display per item.
* @default 1
*/
categoriesPerItem?: number;

@sarahdayan sarahdayan force-pushed the docs/createQuerySuggestionsPlugin branch from 59e319c to 99186af Compare February 26, 2021 18:35
@sarahdayan
Copy link
Member Author

There are additional params since the doc creation:

Addressed in 4d429df.

packages/website/docs/createQuerySuggestionsPlugin.md Outdated Show resolved Hide resolved
packages/website/docs/createQuerySuggestionsPlugin.md Outdated Show resolved Hide resolved

> `number`

The number of items to display categories for.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this description myself quickly but not sure it's very comprehensible. Wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you quickly describe it to make sure it's clear to me?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(With categoriesPerItem: 2)

categoriesLimit: 1

image

categoriesLimit: 3

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! It's how many items get categories. I'm wondering if the name of the parameter is optimal though. Now that I know what it is, categoriesLimit still doesn't convey that idea. Have you thought of something more descriptive like itemsWithCategories? It doesn't convey as much that it expects a number but it's clearer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm not convinced by the name either.

How about those?

  • numberOfItemsWithCategories
  • numberOfCategoriesPerItem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find numberOf superfluous, the type conveys this information already.

  • itemsWithCategories
  • categoriesPerItem

This is simpler.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK—I'll take care of that in another PR.

sarahdayan and others added 2 commits March 1, 2021 13:19
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@sarahdayan sarahdayan merged commit ea2f81b into next Mar 4, 2021
@sarahdayan sarahdayan deleted the docs/createQuerySuggestionsPlugin branch March 4, 2021 12:45
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

Successfully merging this pull request may close these issues.

2 participants