Code Monkey home page Code Monkey logo

solrj-nested-docs's Introduction

Solr Nested Documents and Block Joins
v0.2, 7/1/2014, mark dot bennett at lucidworks dot com

Simple programs to demonstrate Parent / Child joins in Solr
    using the SolrJ API

Requires:
    Java 1.7 or above
    Demo 1: Solr 4.5 or above; 4.9.0 used here
    Demo 2: Requires Solr 4.9.0
    Script assumes Unix Bash Shell
        could run on Windows if proper classpath is set

Demo 1 vs. Demo 2
    Demo 1 shows basic joins
    Demo 2 goes further:
    - Index the nested documents
    - Be able to do normal queries
    - Use parent / child Block Joins in queries
    - Be able to query for either parent or child records
    - Get nested query results with both record types using the [child] Transformer
      (this is new in Solr 4.9.0)
    - Use eDismax to alter the relevancy
    - Show how to use custom parameters
    - Show the full Solr URL to allow for easy edits and testing

Just want to look?
    Just view the files NestedDocs1 & 2.java and sample-output1 & 2.txt

To actually run...

Setup Solr:
    Download Solr (for example 4.9.0)
    Unzip / untar
    cd solr-4.9.0/example
    java -jar start.jar
    # Java code uses fields defined in the default schema.xml

Run this example:
    Be in this main directory
    ./jr1.sh   # jr = "java run"
    ./jr2.sh   # second, fancier demo
    # Ignore warnings starting with "SLF4J: ...", this is just SolrJ logging nonsense.

Recompile:
    This ships with compiled .class files
    But you can recompile with:
    ./jc.sh   # jc = "java compile", compiles both demos
    Perhaps useful if you want to change the code
        or use older Solr or Java versions

solrj-nested-docs's People

Watchers

James Cloos avatar lyxing 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.