#49 AdvancedSearch-0.6.X incl. translations & more improvements

open
nobody
None
5
2014-08-14
2008-06-23
H.-J. Tappe
No

Another patch for this most-wanted feature:
- allow search on "All (Title, Subject, Author)",
- search subtitle in combination to the title
- allow search restriction to categories and / or materials).

This patch is based on a 0.5.X patch but differs from the existing patches in
the following ways:
- Patch against existing files for easy inclusion into the main code trunk
- Make use of existing classes and functions
- Improved selection handling:
- Select inversion instead of select all-which is the same as selecing none)
- Select management separated between categories and materials
- Fix of PHP form management
- Translation support (en is part of this patch)

For the maintainers:
It was noticed that the search feature can be used in several places (OPAC,
Cataloging, ...). Maybe, it could be a good idea to have the search form code in
the shared/-directory and including it wherever needed.

Discussion

  • Logged In: NO

    How to use this patch?

     
  • H.-J. Tappe
    H.-J. Tappe
    2008-07-25

    Logged In: YES
    user_id=2125563
    Originator: YES

    I'm not sure if I understand the question, but I'll give it a try:
    A *.patch file is a standard "unified diff" format (which can be read with a text editor) to show or apply changes to software source code:
    - Lines starting with "+++" or "---" show the original files.
    - Lines starting with "@@" show the patch start lines in the original and modified file plus the lines resulting from the patch (patch length), separated from the start lines by a comma.

    A "patch" program can be used to apply the patch to the source code. If you start in the main openbiblio directory, this patch includes two levels of other directories, which the patch program needs to strip, so e.g. "patch -p2 < advancedSearch.patch" will do the job (Linux example).

    See also (also watch the links to Windows programs at the end of the articles):
    - http://en.wikipedia.org/wiki/Diff#Unified_format
    - http://en.wikipedia.org/wiki/Patch_\(Unix)
    - http://en.wikipedia.org/wiki/Patch_\(computing)

    Another option (in case you don't have access to a patch program) is to modify the source code according to the differences as shown in the file.

     
  • Logged In: NO

    How to install this patch?

     
  • Logged In: NO

    Self-explanatory search mask (adds options to the search, see description), once installed.

     
  • Logged In: NO

    Everything is fine , except "Cataloging." In this section is not sorting properly.
    When looking "magazines" show results and other types of materials.

     
  • H.-J. Tappe
    H.-J. Tappe
    2008-07-26

    Logged In: YES
    user_id=2125563
    Originator: YES

    Thanks for the hint. I uploaded an update of the patch.

    Best regards,
    H.-J. Tappe
    File Added: advancedSearch.patch-0.6.X-1.zip

     
  • H.-J. Tappe
    H.-J. Tappe
    2008-07-26

    AdvancedSearch-0.6.X Update #1

     
  • Logged In: NO

    Now , everything is perfect.Thank you very much.

     
  • Logged In: NO

    How to install it on Windows?

     
  • H.-J. Tappe
    H.-J. Tappe
    2008-07-31

    Logged In: YES
    user_id=2125563
    Originator: YES

    The installation of the patch under Windows is described in the discussion (2008-07-25 08:42) and has been followed (the manual way) already, so I don't see what part is missing. Open the *.patch file and see the differences which have to be applied to the code.

     
  • Logged In: NO

    would it be possible to have this patch broken out in an easier install method? perhaps a zip of the altered files that could be ftp'd to a server? i do not have necessary access to my server to run a *.patch and would have to hand code all this in.

    Any help would be greatly appreciated.

     
  • ayryq
    ayryq
    2010-03-12

    may I suggest the addition of MARC field 505a (formatted contents note) to the search, allowing finding (for example) a short story in a compilation. In BiblioSearchQuery.php
    } elseif ($type == OBIB_SEARCH_ALL) {
    $join .= "left join biblio_field on biblio_field.bibid=biblio.bibid "
    . "and biblio_field.tag='505' "
    . "and (biblio_field.subfield_cd='a') ";
    $criteria =
    $this->_getCriteria(array("biblio.topic1","biblio.topic2","biblio.topic3",
    "biblio.topic4","biblio.topic5",
    "biblio.title","biblio.title_remainder",
    "biblio.author","biblio.responsibility_stmt","biblio_field.field_data"),$words);

     
  • ayryq
    ayryq
    2010-03-12

    Also, it is simple to make this search the default by changing which line says "selected" in:
    catalog/index.php
    opac/index.php

    <option value="title"><?php echo $loc->getText("indexTitle");?>
    ...
    <option value="all" selected><?php echo $loc->getText("indexAll");?>