Developer forum

Forum » CMS - Standard features » Querypublisher sorting on analysed field does not work correctly

Querypublisher sorting on analysed field does not work correctly

Hans Kloppenborg
Reply

Hello,

We have a solution on DW 9.12.4, with a page with a querypublisher where we set the sorting on "Title Ascending". The Title field is defined as "Stored Indexed Analized".

We use this title field on a certan page for the company name. The results on our page are sorted strangely, when the title has more as 1 word it seems that the second word is being used to determine the sort. This results in a sortorder where all the A-singlewords are followed by the B-singlewords until after BU.... we get all the A to Z results, not ordered A-Z, which contain "B.V."  (dutch for Private limited company) as second term. Similar issues occur for every companyname having more as 1 word.

When I remove the analyzed flag from the title field, the sort order is perfect.

Am I wrong to expect the fact if a field is analyzed or not to not have any influence on the sort order?

Greets Hans


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Hans,

 

When a field is "Analyzed", it basically splits a string into individual terms (aka words), and that basically turns it into an array of words, so a word that comes up multiple times is not considered duplicate.

 

Analyzed fields also allow for quicker matches because you can use different operators, whereas with non analyzed field you're forced to use a "ContainsExtended" if you want to fields parts of words or words in the middle, but that's really bad performance-wise.

 

If you need to have a field be analyzed (i.e. for free text search) and sortable too (i.e. such as the Product Name), you need 2 fields in the index, one analyzed and the other one not analyzed.

 

Best Regards,

Nuno Aguiar

Votes for this answer: 1

 

You must be logged in to post in the forum