[OPEN-ILS-DEV] pubdate index
Liam Whalen
liam.whalen at bc.libraries.coop
Fri Jan 31 10:58:48 EST 2014
We have noticed a problem with sorting by date where records with empty date1 values or date1 values with 'u' in them are sorted to the top of the search results in both Newest to Oldest and Oldest to Newest sorts.
I have worked around this with the following fix:
http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=476cf5aa7b14b9934ae5521046eb79c9d3d4573b
But, this forces calculations to happen when sorting, which fails to capitalize on the possibilities of an index.
I suggest that we change the pubdate index to pubdate_asc and pubdate_desc.
In the case of records with no date1 value, pubdate_asc would be given a value of 9999 and pubdate_desc would be given a value of 0.
This will force these records to the bottom of date sorted results.
In the case of records with 'u' characters in date1, we replace all occurrences of u with 9 in pubdate_asc and all occurrences of u with 0 in pubade_desc. This will push these records to the bottom of their relevant date groups.
I can make these changes. Is it a good idea to separate pubdate into two categories like this?
Liam
More information about the Open-ils-dev
mailing list