Autocomplete + categories + hits with templete

Hi guys , I would like to get this example working,

Finall result shoud be having the categories and the hits bellow the autocomplete searchbox.
I also used this doc to add the categories to autocomplete

Now everething is working with the example index.
I can not make it work with my own index , I think that the difficult part is when setting the quierie suggestions.
I already readed the documentation but can not get to a simple working scheme.
Ok ,
The difficult part is:

const querySuggestionsPlugin = createQuerySuggestionsPlugin({
  indexName: 'posts_index_query_suggestions',
  getSearchParams({ state }) {
    return { hitsPerPage: state.query ? 5 : 10 };
  categoryAttribute: [
      /// help me building this!!!
  itemsWithCategories: 1,
  categoriesPerItem: 1,

and this is one of my index example:

  "title": "Bici",
  "country_code": "AR",
  "description": "vendo todo",
  "tags": [],
  "price": 0,
  "negotiable": null,
  "contact_name": "Leostereo",
  "email": "",
  "phone": "+542612516513",
  "phone_hidden": null,
  "address": null,
  "lon": "-68.83",
  "lat": "-32.89",
  "visits": "0",
  "created_at": "2022-02-03T12:41:22.000000Z",
  "created_at_str": "Feb 3, 2022",
  "updated_at": "2022-02-03T12:41:22.000000Z",
  "slug": "bici",
  "url": "",
  "category": "Tools & Accessories",
  "parent_category": "Beauty & Well being",
  "city": "Mendoza",
  "picture": "",
  "objectID": "144"

It would be great if you can provide step by step proceadure to set my querie suggestions only for category refinement.
Hope to be clear …

1 Like

@leandro did you manage to solve this? I am struggling with the same issue