Developer forum

Forum » Swift » Asset list opens wrong file

Asset list opens wrong file

Joakim
Reply

Hi,

We've got a client using the AssetList to list different files and when trying to open 1 out of 2 files on a sorted list clicking either asset opens the first one.

Visiting the link below, opening the asset Hanteringsblad - Resningsankare.pdf instead wrongly opens Hanteringsblad - Ensidigt resningsankare.pdf 
https://www.pretec.se/teknik/kataloger-dokument/dokument?PageSize=30&RequestType=UpdateList&Search=resnings

After some time of debugging, re-adding the assets and rebuilding indexes, I cant seem to pin down the cause of this behaviour.

Any help would be greatly appreciated.

 

Thanks


Replies

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Joakim

I can try to investigate this, but your page returns 404? Screendumps would also be greatly appreciated.


Best regards
Karsten Thuen

 
Joakim
Reply

Apologies, I've updated my original post with the correct link to the production site.
Clicking marked asset opens the wrong one(shown in second image)

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Joakim

Many thanks- Yes this is really weird. It seems we are sending the different assetids to get different results in the slideover. The only suspicious thing I can find, is that the asset ids seems to contain special characters that may not be supported by the query:



You could try to investigate where it comes from.

 

Best regards
Karsten Thuen

 
Joakim
Reply

Hi Karsten,

Those characters seemed to be added from a typo in the template. I have removed them but the faulty behaviour still persists. I'm truly confused by this since I cannot reproduce on any other 2 assets..

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Joakim,

I investigated this a bit further. This is still a tough one, as it is on a very old setup. And I have not been able to recreate it on any of our setups. I can guide you on how you may proceed testing.

These are the direct links for the two examples:
https://www.pretec.se/swift-tools/services/asset-info?AssetId=Hanteringsblad%20-%20Resningsankare.pdf&LayoutTemplate=Swift_PageClean.cshtml
https://www.pretec.se/swift-tools/services/asset-info?AssetId=Hanteringsblad%20-%20Ensidigt%20resningsankare.pdf&LayoutTemplate=Swift_PageClean.cshtml

The setup is using the query publisher app, and it basically responds to the AssetId in the url. We can see that the ids are different, which is great. But the result is wrong. This points us to the index/repository delivering wrong data. There may have been a bug that has been solved on a newer version of Dynamicweb, but it could also simply be that spaces and special characters were not perfectly handled in this version of DW. You could try and rename the two pdfs, without spaces and special chars. And then build the index.


Best regards
Karsten Thuen

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Karsten

Good find - the problem is that the field with the path to the file in the index - which is used for finding the asset - is set to be analyzed. If the field is analyzed, and the filenames have spaces and other characters in it, the path will be broken into seperate terms and then both fields matches "Hanteringsblad" as that would be a single term for both assets,

So the solution is to set the two fields to NOT be analyzed - and run the index again.

 
Joakim
Reply

Thank you for the replies and attention.
How do I go about changing the two fields to not be analyzed?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

These fields are added automatically from the fileschembuilder.

So you have to add the 2 fields manually with new names - and set them to not analyzed. And then change the query to use the non-analyzed fields.

Votes for this answer: 1
 
Joakim
Reply

I've created new fields and adjusted to query to use the new field. After rebuilding the index nothing changes, the issue still persists.
Did I miss something or perhaps maybe I misunderstood the given solution?

 

 

You must be logged in to post in the forum