Developer forum

Forum » PIM » Grouping fields -> grouping and filtering strings

Grouping fields -> grouping and filtering strings

Stephen Jackson
Reply

Hello.

I am now well aquainted with the range grouping for numeric values, but I would like to know if it is possible to apply some kind of grouping to specific string values and/or wildcards.

For example, if I have such a category list.

  • Teddybear
  • Vehicle
  • Plane
  • Pieces of Road
  • Bricks

And I want to create a facet on these, but only want to group by the first 3, and then group all others under "Other", how would I achieve that in a grouping field. I tried simply adding  Teddybear - Teddybear in FROM and TO, and then blank for the both boxes in the "Other" range, but all I got was everything being grouped under Other. Am I trying to do something impossible here? I dont want to have to create more columns, if there is an easy way to fix this with a grouping field index.

Cheers!

//Stephen


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Sounds like you are looking for list facets instead: https://doc.dynamicweb.com/documentation-9/repositories/faceting/facets#4796

 
Stephen Jackson
Reply

Thanks Nicolai. That did it yes.

 
Stephen Jackson
Reply

Actually it turns out that it didnt work completely as I would like, Nicolai

It appears to work for values with no spaces, but not for field values with spaces. 

I suspected this was a Lucene analyze problem, so I made a new index field with no analyze set.

That corrected the number of terms, but it still only works for one value 

Miljøklasse=[EPA+BSO+SAV+EU-RCD]

but for multiple, no

Miljøklasse=[EPA+BSO+SAV+EU-RCD%2CEPA+RCD+EU%2CEPA3+EU-RCD+BSO2+IMO%2CEU-RCD+BSO%2CN%2FA]

The query is defined with the IN operator  ( Field [ Miljøklass_Non_Analyzed ]IN Parameter [ Miljøklasse ] ) so I dont understand why this is not working

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Can you show some of your setup of the index? Like the parameter type, the actual expression and how your facet is defined?

THanks!

 

You must be logged in to post in the forum