Skip to content

elsevierlabs-os/query-insights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Query insights

Purpose

This is a framework to analyze query strings before sending them to a search engine. It comes as a library that can be used in your own project. It also contains a Flask app with two endpoints (suggest and search) and a web interface to interact with it in an experimental way.

Installation

Install the requirements listed in the requirements.txt file or pip install with pip install -e . before running the application. You do need a working Rust toolchain for the Granne library.

Environment

The service reads the following environment variables:

  • ENVIRONMENT (defaults to environment_unset): if set to dev it enables the POSTing a new configuration to the /config endpoint
  • CONFIGFILE (defaults to default.yml): the location of the configuration file
  • LOGGING (defaults to warn): the logging level

Configuration

The service can be configured by composing a custom pipeline of filters. The configuration can be loaded from a config file (set with the CONFIGFILE environment variable). In a dev environment the configuration can be changed through by POSTing a configuration to the /config endpoint.

API documentation

The service exposes a Swagger page under /docs.

Usage

To start the app run uvicorn app:app --port 5000 from within the repo. The web interface will be served on http://127.0.0.1:5000/. Only a minimal set of data is coming with the repo. To use full functionality (like similar queries) you need to get data from an S3 bucket or the file system. The data can be kept outside of the repo, the path can be set in the configuration.

The endpoint can be reached under /suggest, it takes two query parameters:

  • query: the user query
  • product: mendeley or scopus, only important for query rewriting

The response of the endpoint depends on the active filters and can be configured to have the most convenient shape through additional filters.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published