Skip to content

Instantly share code, notes, and snippets.

@janhoy
Created June 24, 2020 09:52
Show Gist options
  • Save janhoy/537e11842927ff515067681c2eaea20f to your computer and use it in GitHub Desktop.
Save janhoy/537e11842927ff515067681c2eaea20f to your computer and use it in GitHub Desktop.

Start Solr with Docker and create a core with our config:

docker run --rm --name solr-example -v $(pwd):/docker -p 8983:8983 -d solr:8.5
docker exec solr-example solr create -p 8983 -c Collection -d /docker/Collection/conf

Index one nested block-join document with two children, each having each one child.

docker exec solr-example curl -s -XPOST "http://localhost:8983/solr/Collection/update?commit=true" -d '
[
  {
    "id": "1",
    "class": "composition",
    "children": [
        {
            "id": "2",
            "class": "section",
            "children": [
                {
                    "id": "3",
                    "class": "observation"
                }
            ]
        },
        {
            "id": "4",
            "class": "section",
            "children": [
                {
                    "id": "5",
                    "class": "instruction"
                }
            ]
        }
    ]
  }
]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment