How to get information for products?

Hello, Algolia support. Help me, please.
I have this DB
algolia_options_1

I need to get options to my template. I already have a working template, with name, brand, image. But don’t understand how to get options?

I traced info in console

but don’t see I needed fields.
What i need to do?

I will use a Mustache format like:

‘{{ #_highlightResult.options.en.labels }}’ +
’ {{ values }}’+
‘{{ /_highlightResult.options.en.labels }}’;

or
‘{{ #options }}’ +
’ {{ #en }}’+
’ {{ #labels }}’+
’ {{ values }}’+
’ {{ /labels }}’+
’ {{ /en }}’+
‘{{ /options}}’;

Hi @altair5555,

Thanks for contacting Algolia. For us to best help you, we’ll need to see your current state even if it is not working as you would like - then perhaps we can give you guidance.

Here is a link that will lead you to some codesandboxes with much boilerplate completed: https://github.com/algolia/create-instantsearch-app#previews

Can you please share with us a codesandbox with the minimal code needed to reproduce your issue?

I can reproduce, but access to DB can’t be shared.

examples with simple DB with actors I used on my example domain. Might be will reproduce there, and show a code.

Do we have in a local cabinet some settings for showings some fields or hide?

@ajay.david thank you for the quick response

Hi @altair5555,

Can you confirm that “options.en.labels”, “options.en.values”, and “options.en.uk_size” have been added to SearchableAttributes?

Hello @jason.sooter i’m using instarsearch v2 this the same, what about are you asking?

upd: removed links

this is from algolia cabinet

Hi @altair5555,

As requested above by @ajay.david, can you create the basic implementation to show your issue in a Codesandbox.io using the template below:

Thanks in advance. I look forward to your reply!
Best regards,

Hi @jason.sooter
codesandbox link
I need to get this attributes: https://prnt.sc/olyi8p (https://prnt.sc/olzfs5) but this another copy index, also there exist original index you can check, but attribute - options do not exist https://prnt.sc/olzbjl
Please tell me what I’m doing wrong.

Do you mean this? https://prnt.sc/olz4uk As far as I understand, if I add these parameters and look for the size in the search field, it will show the products available with these sizes.
I don’t need this, I need to show to the customer, available product sizes in the product list, where sizes not available not to show. https://prnt.sc/olz8qq

Hi @altair5555,

After looking at your codesandbox and the API responses from Algolia, I see that the necessary data is being returned. However, it appears you may be running into the best way to display that data.

Currently, my recommendation would be to restructure the data so that it is a bit easier to access. In the current structure, you’ll have to map or loop through and connect the option keys (labels) to the various option values ( based on order it appears.

A simpler structure might look like:

{
  // ...other properties
  "options": {
    "en": [
      {
        "label": "Size",
        "value": 8,
        "uk_size": 8,
        "us_size": 4,
        "eur_size": 36,
        "xmls_size": "S",
        "it_size": 40,
        "default_size": "no_size"
      },
      // ...other options
    ],
    // ...other languages
  }
}

Let me know how it goes.

Hi @jason.sooter
I think that we are not able to restructure DB.
What a name of DB are you checked? because I didn’t get the options attribute. in the indexName: ‘almall_copy’, I can get options, but this copy, I don’t need this DB. This copy demonstrates that I can get options attribute, but in the main index, I can’t see them. also in console.logs. Can you please check an indexName: ‘price_high_sa’?
Also, I not able map because code written on your mustache, (another developer before me)

question resolved