Developer forum

Forum » CMS - Standard features » Facet list options not considering arrays

Facet list options not considering arrays

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I noticed a behaviour with Facet Lists.

 

We are using a Facet list to merge multiple values with a single option. That works well when I am listing all products and I want to start filtering. However the use case if the other way around.

  • A user does a free text search
  • A bunch of products show up, but the options list only shows if the value is an exact match (not treated as an array)

 

Can we make it so that when the options are processed by DW, they take the parameter's type into consideration, and if it's an array, split the value?

https://www.screencast.com/t/zeuEy0iq

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply

I Am not sure how to do that. Should it then tick it if just one value in the array is matched...? And I am not sure I understand why it differs when searching and not.

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

The expectation is that the option shows up, because there's at least 1 of the values that fits that option.

 

Example:

  • Product A
    • ​PropertyX = 1
  • Product B
    • PropertyX = 2
  • Product C
    • ​PropertyX = 3
  • Facet List Options (for PropertyX)
    • Odd numbers = 1, 3
    • Even numbers = 2

 

Currently the facet would only list the option "Even numbers", but it should list "Odd numbers", picking up 2 products.

 

Does that make sense?

 

Best Regards,

Nuno Aguiar

This would mean 

 
Nicolai Pedersen
Reply

I get it, maybe...

I am not sure I can get Lucene to do that. That would require that the ​PropertyX field is also an array with the in statement to the value.....

I understand what you are trying to achieve - but if above does not work, I do not know how I should make it work. Not even by refactoring our code.

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

I'll keep my fingers crossed. Let me know when you have something (yay or ney) because I need to get back to the customer about it and figured out how to workaround this(not even sure if we can either).

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

I am not doing more.

You could try what I wrote: "That would require that the ​PropertyX field is also an array with the in statement to the value"

You can maybe change how that is setup. Facets and how they are calculated is out of our hands to change in this context.

 
Nicolai Pedersen
Reply

And come to think of it - you should not do your data wash using the facet options. Instead of just having mess, you now have mess with mess on top, and thats a mess....!

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Yep, I hate messes... I will see what I can come up with.

 

Thanks,

Nuno 

 

You must be logged in to post in the forum