cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to sort on tokenized field.

nitinagarwal198
Champ in-the-making
Champ in-the-making
Hi

I want to sort on a tokenized field due to this sorting is not working properly. And I don't want to make this field untokenized. How can i solve this problem.
Please anyone help me.

Thanks,
Nitin
8 REPLIES 8

lista
Star Contributor
Star Contributor
You could have a duplicate property, have it un-tokenized, and use it for sort purposes.
You could insert values into the new property via behavior, rule or something third.

nitinagarwal198
Champ in-the-making
Champ in-the-making
Thanks Lista for your reply.

I have many fields for do the sorting and most of them are tokenized, but i don't want to add duplicate properties for all these field. Can we do this by any other approach?

You could have a duplicate property, have it un-tokenized, and use it for sort purposes.
You could insert values into the new property via behavior, rule or something third.

loftux
Star Contributor
Star Contributor
If you are using javascript, then this may help you
http://forums.alfresco.com/en/viewtopic.php?f=48&t=34670

nitinagarwal198
Champ in-the-making
Champ in-the-making
Hi Loftux,

Thanks for your reply.

I looked on the topic at http://forums.alfresco.com/en/viewtopic.php?f=48&t=34670, but it didn't provide me any solution. Any other solution?

If you are using javascript, then this may help you
http://forums.alfresco.com/en/viewtopic.php?f=48&t=34670

loftux
Star Contributor
Star Contributor
There probably is a solution, but you haven't told us the problem you are trying to solve. Ok partly, you want to sort. But apparently not with javascript. So what do you do when trying to sort?

nitinagarwal198
Champ in-the-making
Champ in-the-making
Hi Loftux,

My problem is that, I have a content Model which have some tokenized properties and I have to do sorting on these tokenized properties. But I am not getting sorted result on tokenzied properties beacuse sorting is working on the basis of last token in tokenized properties, for example, suppose I have a tokenzied property of data type String with the value 'My First Test' then sorting will be on the basis of last token 'Test', So I am getting wrong sorted result.

I don't want to create duplicate untokenized properties for these. I have tried the topic at viewtopic.php?f=48&t=34670, but still i am not getting sorted result on tokenzied properties. I have to do sorting in both js and java webscript for the same.

There probably is a solution, but you haven't told us the problem you are trying to solve. Ok partly, you want to sort. But apparently not with javascript. So what do you do when trying to sort?

loftux
Star Contributor
Star Contributor
Can you try to set tokenisation to "both" and do a full reindex.
http://wiki.alfresco.com/wiki/Full-Text_Search_Configuration#Data_dictionary_options

The cm:name field is tokenised with "both", and that sort apparently works. Sort will, if I remember correctly, put capital before words with lower case, not mixing them.

nitinagarwal198
Champ in-the-making
Champ in-the-making
Hi Loftux,

Thanks a lot, it is working fine now.

Can you try to set tokenisation to "both" and do a full reindex.
http://wiki.alfresco.com/wiki/Full-Text_Search_Configuration#Data_dictionary_options

The cm:name field is tokenised with "both", and that sort apparently works. Sort will, if I remember correctly, put capital before words with lower case, not mixing them.