Skip to content

BCLibraries/bcbento-server

Repository files navigation

bcbento-server

This package provides the back-end for Boston College Libraries' "bento" search page.

Prerequisites

The server requires:

Installation

Use composer to install:

git clone https://github.com/BCLibraries/bcbento-server.git
cd bcbento-server
git fetch
git checkout update-to-php8.1
composer install

Create an .env.local file in the root directory and add any missing or changed values from the .env file. The contents of a working .env.local file can be found in bento documentation on the BC Libraries wiki.

Starting the development server

Use the Symfony local server for development:

symfony serve

Querying the server

Services are provided via GraphQL. You can query the development server interactively using GraphiQL at http://127.0.0.1:8000/graphiql (update the port number as appropriate).

Example queries

Use thr GraphiQL documentation browser to see all available queries and parameters. Some example queries include:

Catalog search

  searchCatalog(keyword: "otters") {
    total
    docs {
      id
      title
      creator
      availability {
        availableCount
        totalCount
        libraryName
        callNumber
        locationName
      }
    }
    facets {
      name
      values {
        value
        count
      }
    }
  }

Librarians

  recommendLibrarian(keyword: "history") {
    docs {
      id
      name
      email
      image
      subjects
    }
  }

Best bets

  bestBet(keyword: "history") {
    title
    ... on LocalBestBet {
      displayText
      link
    }
  }

Testing

Testing is performed using the PHPUnit testing framework.

Integration

Integration tests run queries against the server and try to verify that we are getting sane results. Integration tests must pass before a new deployment is activated.

The integration test file (search-terms-hidden.csv) can be found on the BC Libraries wiki. It must be copied to the tests/integration directory before integration tests can be run.

To run the integration tests:

./vendor/bin/phpunit tests/integration

Indexing

The ElasticSearch indexes are built from the command line.

Librarians

# Build the librarians index
./bin/console librarians:build

# Edit or create a librarian, using their LibGuides ID
./bin/console librarians:edit 1234567

Website

# Build the website index
./bin/console website:build

# Index all website pages
./bin/console website:index --all

# Index website page updated since last indexing job
./bin/console website:index

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Boston College Library's bento search back-end

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages