Skip to content
Eric Pugh edited this page Feb 13, 2020 · 7 revisions

The quickest way to start with RRE is through the available Maven plugins. In this context, you can be in one of the following scenarios:

  • An existing project which already uses Java and Apache Maven: perfect, all you need to do is to configure the RRE plugin in the pom.xml
  • A new project where you will be using Java and Apache Maven: still perfect, the RRE Maven archetype creates a project skeleton with all what you need
  • Existing or new Java project but no Apache Maven: other build management tools are planned for future releases, so the Maven archetype is the right path to follow. It will create a project with all configuration needed for running the evaluation process; you don't need to put any code inside that project, your code will live somewhere else, with some other tool (e.g. Gradle)
  • Existing or new non-Java project: the Maven archetype is still the right choice. With a minimal set of pre-requirements (i.e. Java and Apache Maven), you can create an RRE-enabled module for running evaluation builds.

So at the end, in order to have a first taste of RRE, we need to create a project from scratch (by means of the RRE Maven Archetype) or to configure an existing project. Let's detail both alternatives.

New Project

You should only follow all what is already described in the Maven Archetype page.
The archetype will create a new project skeleton targeted for the requested search platform, with everything already configured. Each folder expected by RRE contains a sample file and a README. You can immediately run an evaluation process using the sample data.

All what you need to provide is real data, that is data extracted from your business domain that will be used for running the evaluation process.

Existing Project

In case you're already working with a Java + Maven project, configuring RRE is pretty trivial. As any regular Maven plugin, we just need to declare and configure it within the pom.xml.
First, we need to declare the Sease repository, because RRE artifacts aren't hosted in the central repository:

<pluginRepositories>
   <pluginRepository>
      <id>sease</id>
      <url>https://raw.github.com/SeaseLtd/rated-ranking-evaluator/mvn-repo</url>
   </pluginRepository>
</pluginRepositories>

...


<plugin>
    <groupId>io.sease</groupId>
    <artifactId>rre-maven-solr-plugin</artifactId>
    <version>7.1.0</version>
    <configuration>
        <configurations-folder>${basedir}/src/solr/configuration_sets</configurations-folder>
        <corpora-folder>${basedir}/src/solr/corpora</corpora-folder>
        <ratings-folder>${basedir}/src/solr/ratings</ratings-folder>
        <templates-folder>${basedir}/src/solr/templates</templates-folder>
        <fields>id,product_name</fields>
        <metrics>
            <param>io.sease.rre.core.domain.metrics.impl.Precision</param>
            <param>io.sease.rre.core.domain.metrics.impl.Recall</param>
            <param>io.sease.rre.core.domain.metrics.impl.ReciprocalRank</param>
            <param>io.sease.rre.core.domain.metrics.impl.AveragePrecision</param>
            <param>io.sease.rre.core.domain.metrics.impl.NDCGAtTen</param>
            <param>io.sease.rre.core.domain.metrics.impl.PrecisionAtOne</param>
            <param>io.sease.rre.core.domain.metrics.impl.PrecisionAtTwo</param>
            <param>io.sease.rre.core.domain.metrics.impl.PrecisionAtThree</param>
            <param>io.sease.rre.core.domain.metrics.impl.PrecisionAtTen</param>
        </metrics>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>evaluate</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The Wiki contains a detailed description of the Maven Plugin; once this has been setup you can run the evaluation process by executing one of the follow commands:

> mvn install
> mvn rre:evaluate

The Maven Plugin produces the evaluation result as a JSON file, under the target/rre directory. Another plugin, which is actually a Maven Reporting Plugin, takes this data in input and produces different outputs. The reporting plugin must be configured as in the following example:

<plugin>
    <groupId>io.sease</groupId>
    <artifactId>rre-maven-report-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <formats>
            <param>spreadsheet</param>
            <param>rre-server</param>
        </formats>
    </configuration>
    <executions>
        <execution>
            <phase>post-integration-test</phase>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Note that, although it's a Maven Reporting Plugin,it has to be configured under the build/plugins section, in the pom.xml.

The sample configuration above uses two outputs (the two available at the moment). The first is a spreadsheet which produces a file that can be read with LibreOffice Calc or Microsoft Excel. The second format sends the evaluation data to a running RRE Server instance. If the server is not running and up, then the plugin will report a connection error.

The plugin can be executed directly within the build cycle or explicitly using the following command:

> mvn rre-report:report

The spreadsheet will be created under the target/site folder.