Giter Site home page Giter Site logo

atj / mb-solr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metabrainz/mb-solr

0.0 1.0 0.0 392 KB

MusicBrainz Solr query response writer

Home Page: https://musicbrainz.org/doc/Development/Search_Architecture

License: BSD 3-Clause "New" or "Revised" License

Shell 2.38% Java 92.03% Lex 3.85% Dockerfile 1.74%

mb-solr's Introduction

MusicBrainz Solr Build Status

This package includes a QueryResponseWriter for Apache Solr that will generate mmd-schema compliant responses for Solr cores running on an mbsssss schema.

Licensing

Note - Part of the code at org.musicbrainz.search.analysis is adapted almost entirely from Lucene core libs. As such those files are licensed under Apache 2.0 license which is compatible with the existing BSD license of MB-Solr.

Installation

Installing brainz-mmd2-jaxb

Clone the repository with Git:

git clone https://github.com/metabrainz/mmd-schema.git

And install the package:

cd mmd-schema/brainz-mmd2-jaxb
mvn install

Installing the query writer

Clone the repository with Git:

git clone --recursive https://github.com/metabrainz/mb-solr.git

Navigate to the mb-solr folder in a terminal and build a JAR file:

mvn package

This will create a file called solrwriter-0.0.1-SNAPSHOT-jar-with-dependencies.jar in the target folder.

Now you need to make this JAR file available to all Solr cores that need it. The easiest option is to configure a sharedLib in your solr.xml and put the JAR file into that.

All that's left to do now is enabling the Query Response Writers in your cores solrconfig.xml. To do that, add the following lines as children of the config element:

    <queryResponseWriter name="mbxml" class="org.musicbrainz.search.solrwriter.MBXMLWriter">
        <str name="entitytype">$entitytype</str>
    </queryResponseWriter>
    <queryResponseWriter name="mbjson" class="org.musicbrainz.search.solrwriter.MBJSONWriter">
        <str name="entitytype">$entitytype</str>
    </queryResponseWriter>

The solrconfig.xml of the cores defined by mbsssss already includes this snippet, as well as the sharedLib configuration in the solr.xml file.

$entitytype needs to be replaced by the entity type of the documents in the store. Valid values are:

  • annotation
  • area
  • artist
  • cdstub
  • editor
  • event
  • freedb
  • instrument
  • label
  • place
  • recording
  • release
  • release_group
  • series
  • tag
  • work
  • url

Now the core needs to be reloaded. After that, two new values for the wt paramter are available:

  • mbxml, which returns mmd-compliant XML documents
  • mbjson, which returns JSON document as described by this page

At the moment, the field list parameter of each query needs to include the score field for the code to work correctly.

A branch of the MusicBrainz server that can query a Solr server with this QueryResponseWriter is available on GitHub.

Known Vulnerabilities

  • CVE-2021-44228: It can be mitigated by setting the environement variable LOG4J_FORMAT_MSG_NO_LOOKUPS=true.

Docker Installation

Clone the repository with Git:

git clone --recursive https://github.com/metabrainz/mb-solr.git

Either run it alone on port 8983:

docker-compose up

Or build a tagged image to run with MusicBrainz Docker:

./build.sh

mb-solr's People

Contributors

mineo avatar samj1912 avatar jeffweeksio avatar yvanzo avatar amcap1712 avatar alastair avatar gentlecat avatar mwiencek avatar reosarevok avatar

Watchers

 avatar

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.