Koha/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
David Cook f6daff353d Bug 9368 [ALTERNATE] - specific behavior of yr and acqdate indexes
This patch fixes the "Publication date" and "Acquisition date"
searches when using non-QueryParser and QueryParser searches.

It adds structure attributes to the template, which is consistent
with how phrase searching is currently handled.

It removes unnecessary code from Search.pm, adds some necessary
code which is consistent with existing code, and adds a lot of
explanatory comments.

_TEST PLAN_

Before applying:
0) Turn off QueryParser
1) Try a "Publication date" or "Acquisition date" search from the
staff client advanced search.
2) Note that even though the description on the result page makes
it seem like you're doing an index-specific search, you're actually
doing a keyword search. You can verify this by checking the 008
from positions 7 to 10 for "Publication date" or "Date accessioned"
on items for "Acquisition date".

3) Turn on QueryParser
4) Try doing the searches from Step 1.
5) A "Publication date" search should probably produce zero results

After applying patch:
6) Keep QueryParser on
7) Try doing the searches from Step 1.
8) Notice that you're actually getting results consistent with
your search (ie the 008/7-10 shows the date you searched for,
and there is a "Date accessioned" in items which matches your
search)

9) Turn off QueryParser
10) Note that your results are exactly the same as step 8
(N.B. this is because QueryParser is falling back to non-QP mode
instead of producing a bad query.)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-22 15:16:55 -03:00

54 lines
2.7 KiB
HTML

<select class="advsearch" name="idx">
<option value="kw">Keyword</option>
<option value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword as phrase</option>
<option value="au">Author</option>
<option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as phrase</option>
<option value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
<option value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
<option value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name as phrase</option>
<option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name as phrase</option>
<option value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
<option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name as phrase</option>
<option value="ti">Title</option>
<option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as phrase</option>
<option value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series title</option>
<option value="su">Subject</option>
<option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as phrase</option>
[% IF ( expanded_options ) %]
<option value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
<option value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
<option value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
[% END %]
<option value="bc">Barcode</option>
<option value="location">Shelving location</option>
[% IF (numbersphr) %]
<option value="sn,phr">Standard number</option>
[% ELSE %]
<option value="sn">Standard number</option>
[% END %]
<option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
<option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
[% IF (numbersphr) %]
<option value="callnum,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
[% ELSE %]
<option value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
[% END %]
<option value="ln,rtrn">Language</option>
<option value="nt">Notes/Comments</option>
[% IF (marcflavour != 'UNIMARC' ) %]
<option value="curriculum">Curriculum</option>
[% END %]
<option value="pb">Publisher</option>
<option value="pl">Publisher location</option>
[%#
Use non-normalized st-year instead of st-numeric,
since pubdate can include 'u' to signify unkown
dates. See "Legal Characters" at:
http://www.loc.gov/marc/bibliographic/bd008a.html
This search is also for date ranges due to the
special Zebra r=r CCL mapping for 'yr'
%]
<option value="yr,st-year">Publication date (yyyy-yyyy)</option>
<option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option>
</select>