Code Monkey home page Code Monkey logo

arix-search-adapter's Introduction

ARIX-search-adapter

Build Status Dockerhub Automated Build Status

This is a search adapter for the content search of Antares.

Setup

Install Go.

Testing

go get github.com/stretchr/testify/assert

This code

go get github.com/schul-cloud/arix-search-adapter

Test this code

go test github.com/schul-cloud/arix-search-adapter/arix

Run the search engine server

go build github.com/schul-cloud/arix-search-adapter && ./arix-search-adapter

Try it out

After Setup, you can run this command to request a search:

curl -i 'http://localhost:8080/v1/search?Q=Einstein'

Configuration

You can configure the server by setting environment variables. Here you see the environment variables with their explanation:

  • ARIX_SEARCH_SERVER defaults to http://arix.datenbank-bildungsmedien.net/
    This is the URL the server uses for requests. It is expected to find an ARIX compatible endpoint there.
  • ARIX_SEARCH_CONTEXT defaults to HH
    This is the search context. This influences wich search results can be found.
  • ARIX_SEARCH_SECRET defaults to `` (not set)
    This is the secret to verify that the user has the license for the material which is requested. Note that a secret may be bound to an IP address where the requests must come form to succeed.
  • ARIX_SEARCH_PORT defaults to 8080
    This is the port the search server listens on.
  • ARIX_SEARCH_LIMIT defaults to 10
    This is the maximum number of resources to request.
  • ARIX_SEARCH_SERVER_ID defaults to ARIX
    This is the id of the arix server. This can be used if you use mutiple servers to identify the resources.
  • ARIX_SEARCH_LINK_TYPE defaults to direct
    This is the type of the resource link. These options are available:
    • direct - Links show a media player or the resource in the users browser.
    • download - Links make the browser download the content.

You can configure the server by running these commands:

  • Linux
    export ARIX_SEARCH_SECRET=...
  • Windows
    set ARIX_SEARCH_SECRET=...

Repository Layout

The repository layout is inspired by this blog post

Docker

You can run this container with docker:

docker run -p 8080:8080 -e “ARIX_SEARCH_SECRET=<your secret>” schulcloud/arix-search-adapter

To build the container, run this:

docker build -t schulcloud/arix-search-adapter .

arix-search-adapter's People

Contributors

niccokunzmann avatar

Watchers

James Cloos avatar Raymond Lochner avatar

Forkers

openschulcloud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.