[Koha-bugs] [Bug 753] New: Apostrophes and commas cause marc_word search to fail

bugzilla-daemon at wilbur.katipo.co.nz bugzilla-daemon at wilbur.katipo.co.nz
Mon Mar 22 16:43:05 CET 2004


http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=753

           Summary: Apostrophes and commas cause marc_word search to fail
           Product: Koha
           Version: CVS
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalogue
        AssignedTo: paul.poulain at free.fr
        ReportedBy: shedges at athenscounty.lib.oh.us
         QAContact: koha-bugs at lists.sourceforge.net


The new (HEAD) search.marc/search.pl and SearchMarc.pm fail when a comma or an
apostrophe is present in the search term(s).

Two examples:

* search for author "Henry, Sue" converts to a "like 'Henry,%' and like 'Sue%'"
select on marc_word, which fails because of the comma (commas cannot be stored
in marc_word);

* search for title "I'll be home for Christmas" fails because marc_word removes
apostrophes (which is a good thing to do for the French language?, certainly not
good for the English language) and the search finds no "I'll" in marc_word.

To fix the first example, commas should be stripped from the end of search terms
($term=~ s/,$//).  Commas in the middle of a term could indicate sloppy typing
by the searcher, e.g. "Henry,Sue" with no space between terms.  In the case of a
comma in the middle of a term, the comma should be used to split the term into
two separate terms.

To fix the second example, assuming that marc_word still does not save
apostrophes, then search terms containing an apostrophe should be ignored. 
Stripping the apostrophe from the term ("I'll" becomes "Ill") would result in
incorrect "hits" in marc_word and sloppy search results.



------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




More information about the Koha-bugs mailing list