Developer forum

Forum » Ecommerce - Standard features » Category fields with special values

Category fields with special values

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I am using the Data Integration Framework to import data. One of the Category Fields contains data like this:

ages 12+

It imports fine, but the filters trip over it beause (I think) the space and plus character and returns no results.

What can I do to prevent this issue? Is there a way to encode the data so the indexer doesn't have any problems with it?

Imar


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Bump. Anyone has any suggestions? The same issue just occurred on another (live) site causing all the filters to break. A fix or suggested work around would be highly appreciated....

Thanks,

Imar

 
Adrian Ursu
Reply

I think you have to turn it into a key/value pair.

Storing the data as text will encourage the indexer to split the string and index it as 2 separate strings: ages and 12+. As far as I know, the indexer is pretty sensitive to special chars although + is fairly common. We had trouble with - as well.

Therefore, turn the field into a select field, then define the age pairs and allocate an indexer-friendly system name to the option.

We have used this with this solution: www.eurobike.ro . You will see that the values of the fields contain space:

http://www.eurobike.ro/Biciclete/MTB-Hardtail?Price=&tipFranaHardtail=Hidraulica_pe_disc

And everything (or almost everything) is stored in Product Categories

 
Nicolai Høeg Pedersen
Reply

Hi Imar

I've asked the dev team to look into the issue and see if we can reproduce it and make a fix if possible!

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Great, thank you!

 

Imar

 
Vladimir
Reply

Hi Imar,

Fixed this issue with 16441

Lucene searcher should find now such values with KeyWordAnalizer - it is field types: text(5),  text(20),  text(50), text(100), List (except multiselects)    

 

Best rregards,

Vladimir

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Great. Will this made available in the 8.5.1 branch? And if so, is there a timeline for that release?

Thanks!

Imar

 
Christian Rud Skovgaard
Reply

Hi Imar,

 

This fix will appear in 8.5.1.12 which will be released within a week.

 

Kind regards

Christian

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Excellent, thanks!

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

FYI: I just upgraded to 8.5.1.13 and now the frontend rendering of a pge with filters fails with the following message:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Searching.Specialized.eCommerce.ProductFieldsFilterProvider.GetFieldInfo(Boolean& needWrap, Boolean& isKeywordAnalizer)
   at Dynamicweb.Searching.Specialized.eCommerce.ProductFieldsFilterProvider.ConvertToCriteria(String fieldName, String value, CriteriaExistanceConstraint cons)
   at Dynamicweb.Searching.Specialized.eCommerce.ProductFieldsFilterProvider.ConvertRequestValue(FilterRequestValue value)
   at Dynamicweb.Searching.Specialized.eCommerce.ProductFieldsFilterProvider.EstimateResults(FilterRequestValue value)
   at Dynamicweb.Searching.Specialized.eCommerce.ProductFieldsFilterProvider.Render(Template template)
   at Dynamicweb.Extensibility.Searching.eCommerce.FilterRenderer.Render(Template loopTemplate, Template masterTemplate)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderSearchFilters(Template template, IEnumerable`1 filters)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderSearchFilters(Template template)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderSearchTemplate()
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProducts(ProductCollection Products, Template ParentTemplate, String LoopName, Int32 LoopCounter, Boolean renderRelatedProducts, Boolean renderRelatedLists)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProducts(ProductCollection Products, Template ParentTemplate)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProducts(ProductCollection Products)
   at Dynamicweb.eCommerce.Frontend.Frontend.ListProducts(ProductCollection products, String groupsIdent, Boolean hasBeenSorted)
   at Dynamicweb.eCommerce.Frontend.Frontend.List(String groups)
   at Dynamicweb.eCommerce.Frontend.Frontend.EcomRender()
   at Dynamicweb.eCommerce.Frontend.Frontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModule(DataRow& ParagraphRow)

 

As soon as I revert back to 8.5.1.11 the problem goes away.

Any thoughts?

Imar

 
Vladimir
Reply

Hi Imar,

thank you for notice,\will fix it asap (16557)

Best regards,

Vladimir

 
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Imar

The problem TFS#16557 "Frontend rendering of a page with filters fails"  has now been fixed in version 8.5.1.14

You are able to find this build in the download section:

http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

I tested this in a local development environment and the bug is gone. Thanks. Will let you know if something comes up when I deploy to live but so far it looks good.

Imar

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi guys,

Most of it now works, but I still have an issue with special values like "ages 3+". The item gets indexed correctly (as the count for the filter looks good) but when I select the item I see now results. The value is URL encoded when going to the server (e.g. something like Ages+3%2B for something like Ages 3+) btu it never returns any results.

Can you take another look at this? I can provide a sample site if needed to demonstrate the prroblem.

Imar

 
Vladimir
Reply
This post has been marked as an answer

Hi Imar, 

If search values contains special values, it is should be used .ValueEncoded tag in search template for values, e.g.:

value="<!--@Ecom:Search.Filter.Option.ValueEncoded-->"

or

value="<!--@Ecom:Filters.ProductFields.Row.ValueEncoded-->"

the filter will be able to handle such(ages 3+) values...

Best regards,

Vladimir

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Vladimir,

Thanks, that fixed the issue.

Imar

 

You must be logged in to post in the forum