cancel
Showing results for 
Search instead for 
Did you mean: 

Date Sorting via Lucene in Web Script

howejr77
Champ in-the-making
Champ in-the-making
We have a Java backed web script which is running a lucene query and attempting to sort against a date property which is populated via metadata extraction in WCM.

We are encountering an issue where the web script works perfectly in our Authoring environment but when we deploy the content to the Runtime environment, the sorting no longer works and the wrong content is returned. From what we can tell the deployment has moved all the content and properties successfully and have even used a tool to inspect the Lucene indexes and can see the property populated in the indexes. We've gone through recreating the indexes and I've even reinitialized the runtime environment and redeployed the whole site.

Anyone have any suggestions? We are basically on the verge of returning a large amount of content and sorting ourselves which we would rather not do.

Thanks
Ryan
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Are your two environments running the same version of Alfresco?
Have they got the same config?
What date are you sorting on - and are you sure it is not being set to one value as part of the deploy.
Is the meta data correct after deployment?

Andy

howejr77
Champ in-the-making
Champ in-the-making
Yes, it is the same version of Alfresco. If you look at help ticket 6041, you will see where this is (you may have even helped look into it). We don't know what the problem is but have basically gone done the approach pulling all the children nodes in the webscript, retrieving the custom date parameter and sorting them ourselves.

Basically, the Lucene query would work properly in the authoring environment but in the Runtime environment it would "flip" the first and last entry (if not some more) actually giving us the oldest one first.

We haven't solved this but it has gotten old enough that we've coded away from using Lucene.