Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Advanced search

2010-12-20
2013-05-30
  • I would like to include the 505 field (formatted contents) in the advanced search. Does anyone know how to do it?

     
  • ayryq
    ayryq
    2010-12-20

    In .61, with the "search all" patch installed, here's an excerpt from my classes/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);
          } else {
    

    I made this work a long time ago… I'm not positive this is all you need, but it's the first reference to 505a that I found.

     
  • Fred LaPlante
    Fred LaPlante
    2010-12-20

    Here is a solution that adds ISBN as a searchable item to the pull down list. You could easily modify this to add most any other field you like. I did this with 0.7, but a suspect it would work with ver 0.61 with little change.

    First we need to add to file '../shared/global_constants.php' near line# 29
        define("OBIB_SEARCH_ISBN","6");

    And in file '../locale/en/cataloging.php' near line 58:
        $trans             = "\$text = 'Isbn';";

    And in file '../catalog/index.php' near line 55:
    <option value="isbn"><?php echo $loc->getText("indexIsbn");?>

    And in file '../classes/BiblioSearchQuery.php' near line 85:
          } elseif ($type == OBIB_SEARCH_ISBN) {
            $join .= "left join biblio_field on biblio_field.bibid=biblio.bibid "
                     . "and biblio_field.tag='020' "
                     . "and (biblio_field.subfield_cd='a') ";
            $criteria = $this->_getCriteria(array("biblio_field.field_data"),$words);

    Fred LaPlante

     
  • Ayryc links to what is called the Advanced Search patch. (Personally I wouldn't call it advanced because the functionality is different from what usually is called advanced search in catalogs.)

    Many users find it difficult to apply a patch file, so I made it available as a file download for 0.6.x and 0.7.x
    Ayryc's suggestions for the patch are included.
    Attached as a .zip file to:
    https://bitbucket.org/mstetson/obiblio/issue/34/setup-up-search-like-uhrc-library