Developer forum

Forum » Ecommerce - Standard features » DynamicFacets HowTo

DynamicFacets HowTo

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to optimize performance by using DynamicFacets.

What I don't understand about it, is if I still need to define Expressions in Query for each parameter used in the Facets

I have made the following steps:

1. I have set the "Allow dynamic facets from existing facet groups" on the ProductCatalog App

2. I have defined a Query with a simple set of parameters and a basic set of expressions. I have not defined individual queries for each Parameter used for facets

3. I have defined a Facet with a few options

4. On the Group, I have selected the facet to be displayed.

5. I have navigated to the ProductGroup page

The facets are not displayed on the ProductGroup page.

The documentation is very brief about it and I am not sure what I should expect from this functionality and what would be some use cases for it.

Thank you,

Adrian 

 


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Anybody?

Thank you,
Adrian

 
Nicolai Pedersen
Reply

2+3 sounds odd. How did you make your facets in 3 if you have no parameters defined?

You should setup your facets as usual, and then on the product group settings, enable only those needed. Consider a common facet definition and one for each group type if that makes sense in your setup.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I believe I don't understand the use case of the Dynamic Facets.

Are the settings on the groups taken into consideration ONLY when allow dynamic facets is set to true on the Product Catalogue?

In another post about performance, you have suggested splitting the query if there are a lot of expressions.

I have split them and configured a dedicated page for each Level 1 category and I have placed a dedicated ProductCatalog on each of them and set the Ecommerce navigation accordingly.

Is there any other way I could have done the split or optimization of the Query?

I guess that's whay I started to play with this Dynamic facets in the first place.

The performance seems to be affected by the query and not by the facets but I might be wrong.

Thank you,
Adrian 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

There are semi dynamic facets and fully dynamic facets.

Semi dynamic facets is used where you specify your facets as always - and maybe group them in a number of seperate facet definitions for ease of administration.

Then on the group, you can specify which facets is active in that context - lets say you have maybe 100 facets in total, but only 10 is valid for a given group - those are the ones you activate. Now the facet calculation for that group will only be conducted for those 10 facets and not the 100 - making it much faster. See my dumps.

Fully dynamic facets, is another scenario where you use querystrings to define facets on the fly. You will not specify any anywhere, and then using querystring paramters on a catalog that has it enabled, you can say which fields you want facets for. We see this for some solutions with maybe 500+ facets that they think they need. Then you can do some macgic on a group where you can define which fields you want as facet etc. It is a corner case, but we made it now we had this one open.

Query and facets are calculated in one go. So the querytime you see in the debug includes all of it. Attached find a pirate lucene dll that will give you more precise timings - see last dump

BR Nicolai

Capture.JPG Capture2.JPG Capture3.JPG Capture4.JPG Capture5.JPG
Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thyank you for the thorough explanation. This is the kind of knowledge sharing that I was looking for.

I have been struggling with search, filtering and indexing ever since DW 8.xx. The whole complexity of the indexing makes a lot more sense now. I might eventually be able to get the hang of it once and for all.

Thank you very much.

Adrian

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

BTW, love the fact we'll get granular timing on where time is being spent. This is extremely helpful when we're searching for problems or ghosts in the system. If nothing else prevents us from going down wrong paths

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I am trying to come back to the regular approach on having a single ProductCatalog page and use the DynamicFacets as you have described.

Clearly, after moving to this scenario, the performance decreased visibly. Therefore I need to tweak it more if I want it to be viable.

I have used the Pirate DLL and I got the following:

Index query executed - took 1166,4843 ms:
+Active:True +(ParentGroupIDs:SHCT01) +LanguageID:LANG17 +ShowMasterOrVariantInList:True +ShopIDs:SHOP14 +(+*:* -(+CustomField_CategorieDSC:DSCS)) +Price:{0 TO *] TIMINGS HandleParameters (47ms); ParseQueryExpression (101ms); BuildSortOrder (105ms); SetDefaultFieldSortScoring (106ms); searcher.Search (190ms); ScoreDocs (190ms); DoSearch (203ms); DoFacetSearch (1166ms); Spellcheck (1166ms); 

From what I can tell, DoFacetSearch and Spellcheck took most of the time.

How do I investigate further my options?

Should I try the Full DynamicFacets?

Thank you,
Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

The MS after each task in the query is a sum of all tasks until then. So handling parameters is 47 ms parsing the query is 101-47 = 54ms. 

So parsing the query and searching the index is a total of 203 ms. The facets are 1166-203 = 963 ms. So that is the slow part. Spellcheck is 'free' as it takes 1166-1166 = 0 ms.

So facets are slow because you have a lot. Either many different facets or facets with many options (the yellow warning in the backend).

You can bring down the number of facets by using the dynamic facet per group feature and by only enabling a limited set of facets for non group pages, i.e. a search. (you have to use the "GroupID" parameter for the semi dynamic facets to take affect)

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for clarifying it for me. It totally makes sense.

I have played a bit with the Fully Dynamic Facets and they seem pretty useful.

For now I will just use a Long text field to save them there but on the long run I should probably create a Custom Field type that would allow Selecting the fields, Naming them and sorting them. I guess that's possible now, right?

Thank you very much.

Adrian

 

You must be logged in to post in the forum