Developer forum

Forum » CMS - Standard features » New index - values and labels

New index - values and labels

Nuno Aguiar
Reply

Hi,

 

We have a webshop where we need to index a few multi-select fields. The problem is that we need to index not only the values, but also the labels assign to it. Can we do that without having to create 2 seperate fields (1 to store values and another to store labels assigned to those values)?

 

Basically we need to mimic what we have for groups, where we index both the groupIDs and groupNames, but based on a product category field

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

Could you give an example. Not sure I understand what. Do you want values and labels in the same field in the indexed document?

 
Nuno Aguiar
Reply

Hi,

 

I have a product category field called "Composers" as a list box. Example:

Option Name/Label Option Value
Nuno Aguiar C00123
Nicolai Pedersen C00321

 

Since the values are C00123 and C00321, that's what's being indexed, but we want people to search for "Nuno Aguiar" not C00123. This is representative for a number of fields and we might need C00123 as well for other purposes.

 

So I would need to have both Nuno Aguiar and C00123 to be indexed. Is that possible? I guess not, but probably something for 8.7.1?

 

Makes sense?

 

BR

Nuno Aguiar

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

Then you already have a field in the index called variantoptions (containing the C00123 numbers) and you also have a field called "Composers" (name of your group) with the names in an array...

BR Nicolai

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Yes, because depending on the project and type of data, we might need to search for values or their labels/names. If that were possible to index (based on the language), would be awesome.

 

Currently the only workarounds I see are not perfect:

  • Use the names as values (unless they have spaces and special characters
  • Use a different field to store the names ("duplicate" data in the DB and/or having the customer to fill the same info twice if does not come through integration)

 

Does that make sense?

 

Best Regards,

Nuno Aguiar

 

 

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

You can search for variant names (i.e. Red, Black etc.) in the context language using the variantoptions field. See dump 1 + 2. The index contains the names of the variant in that field, see Luke dump. Setup the search for that field i.e. with the free text field.

When doing facets on that same variant group (Color), you use the variantgroup field - see dump 3.

In that way your facets will search using the value (VO1 etc.) and free text will search using the labes (Red, Black etc.)

Capture.PNG Capture1.PNG Capture2.PNG
 
Nuno Aguiar
Reply

Hi Nicolai,

 

That does not work for me because:

  • I need this for product category fields (Listbox - not variants)
  • I need to assign a boost value to that specific field

 

My free text search is a negated group expression for some fields with different boost values for each field.

 

Any other thoughts?

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum