Bug 15694 - Date/time-last-modified not searchable
Summary: Date/time-last-modified not searchable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Nicole C. Engard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-28 17:24 UTC by Nicole C. Engard
Modified: 2017-06-14 22:10 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15694: Add aliases for date/time last modified (1.65 KB, patch)
2016-01-28 17:26 UTC, Nicole C. Engard
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15694: Add aliases for date/time last modified (1.75 KB, patch)
2016-02-01 16:00 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15694: (followup)Update DOM index filter definitions (2.09 KB, patch)
2016-02-02 15:55 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15694: (followup)Update DOM index for UNIMARC/biblios (2.38 KB, patch)
2016-02-08 16:20 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15694: Add aliases for date/time last modified (2.00 KB, patch)
2016-03-03 09:46 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 15694: Add aliases for date/time last modified (2.07 KB, patch)
2016-03-11 09:00 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2016-01-28 17:24:29 UTC
There is na index for Date/time-last-modified but the slash (/) can cause issues. This patch will add aliases for this field.
Comment 1 Nicole C. Engard 2016-01-28 17:26:07 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2016-01-28 17:26:28 UTC
This is my first ever patch like this so I welcome feedback.
Comment 3 Héctor Eduardo Castro Avalos 2016-02-01 15:59:17 UTC
Maybe a better test plan for example:


To reproduce the issue:
-Choose a bib record and copy the date in 005 field
-search under Date/time-last-modified:20160201094709.0
-No results found

To test:

1. apply patch
2. reindex
3. search for dtlm:DATE and date-time-last-modified:DATE
4. confirm that you get results
Comment 4 Héctor Eduardo Castro Avalos 2016-02-01 16:00:37 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-02-02 10:47:22 UTC
Nicole,
I think the files biblio-koha-indexdefs.xml and biblio-zebra-indexdefs.xsl need to be updated when a zebra index is added/deleted/modified.
Comment 6 Héctor Eduardo Castro Avalos 2016-02-02 15:55:04 UTC Comment hidden (obsolete)
Comment 7 Héctor Eduardo Castro Avalos 2016-02-02 16:00:31 UTC
(In reply to Jonathan Druart from comment #5)
> Nicole,
> I think the files biblio-koha-indexdefs.xml and biblio-zebra-indexdefs.xsl
> need to be updated when a zebra index is added/deleted/modified.

Hi Jonathan and Nicole

This really works without update the files. My question is why?
Comment 8 Jonathan Druart 2016-02-08 12:46:01 UTC
It does not work for me with only the first patch applied.
The changes need to be made for normarc and unimarc as well.
Comment 9 Héctor Eduardo Castro Avalos 2016-02-08 16:07:05 UTC
(In reply to Jonathan Druart from comment #8)
> It does not work for me with only the first patch applied.
> The changes need to be made for normarc and unimarc as well.

Hi Jonathan

It seems to be that NORMARC does not use this index.
Comment 10 Héctor Eduardo Castro Avalos 2016-02-08 16:20:28 UTC Comment hidden (obsolete)
Comment 11 Jason Burds 2016-02-08 20:11:28 UTC
Tried a few times to get this to work.

date-time-last-modified:DATE doesn't search for anything on the sandboxes.

Are you able to search for a date modified on a record that's already there or does it require a reindex to fix the searching or just find new records?
Comment 12 Katrin Fischer 2016-02-08 20:17:27 UTC
Hi Jason, indexing patches are usually not testable on the sandboxes to my knowledge. On a dev installation you'd have to do a full reindex after copying index definition files into the correct place.
Comment 13 Héctor Eduardo Castro Avalos 2016-02-08 20:31:04 UTC
(In reply to Jason Burds from comment #11)
> Tried a few times to get this to work.
> 
> date-time-last-modified:DATE doesn't search for anything on the sandboxes.
> 
> Are you able to search for a date modified on a record that's already there
> or does it require a reindex to fix the searching or just find new records?

Hi Jeson

You need to reindex.

For example I have a record in MARC21 with field 20160201110256.0

Apply patch
reindex zebra

and search again

dtlm:20160201110256.0

or

Date-time-last-modified:20160201110256.0

and the system retrieve my record.

I don't know if you can reindex Zebra in sandboxes :(

Regards
Comment 14 Frédéric Demians 2016-03-03 09:39:02 UTC
There is something wrong here. The 1st patch is enough. No reindexing is required since 'Date/time-last-modified' index is already defined. After adding an alias in ccl.properties (1st patch), and copying ccl.properties in the installed configuration, restarting the Zebra server is all you need to do to get working searches without prefix with ccl=
Comment 15 Frédéric Demians 2016-03-03 09:41:27 UTC
You don't have to add a new index: <target_index>dtlm:w</target_index>

'dtlm' is just a CCL shortcut to the already existing index Date/time-last-modified.
Comment 16 Frédéric Demians 2016-03-03 09:42:33 UTC
Comment on attachment 47561 [details] [review]
Bug 15694: (followup)Update DOM index filter definitions

Not required
Comment 17 Frédéric Demians 2016-03-03 09:42:51 UTC
Comment on attachment 47741 [details] [review]
Bug 15694: (followup)Update DOM index for UNIMARC/biblios

Not required
Comment 18 Frédéric Demians 2016-03-03 09:46:07 UTC Comment hidden (obsolete)
Comment 19 Jonathan Druart 2016-03-11 09:00:42 UTC
Created attachment 48991 [details] [review]
Bug 15694: Add aliases for date/time last modified

This patch will add indexes for Date/time-last-modified.

To test:

1. apply patch
2. reindex
3. search for dtlm:DATE and date-time-last-modified:DATE
4. confirm that you get results

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  I confirm Hector signing-off. A simple Zebra server restart suffice to get
  working the searches on date-time-last-modified and dtlm.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 20 Jonathan Druart 2016-03-11 09:01:56 UTC
Frédéric was right, sorry Héctor for the additional work :-/
Comment 21 Brendan Gallagher 2016-03-11 21:57:35 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 22 Julian Maurice 2016-03-14 09:41:15 UTC
Patch pushed to 3.22.x, will be in 3.22.5