Code Monkey home page Code Monkey logo

abstract.recipe.haystack-solr's Introduction

Overview

This is a recipe to set up and configure SOLR in a django-haystack environment.

Basic setup

A basic buildout configuration using this recipe looks like this (using djc.recipe):

[buildout]
eggs = django-haystack
parts =
    solr-download
    solr
    django

[django]
recipe = djc.recipe
project = dummydjangoprj

[solr-download]
recipe = gocept.download
url = http://mirror.nohup.it/apache/lucene/solr/3.4.0/apache-solr-3.4.0.tgz
strip-top-level-dir = true

[solr]
recipe = abstract.recipe.haystack-solr
solr-location = ${solr-download:location}
django-settings-file = ${django:location}/settings.py
eggs =
    ${buildout:eggs}
    ${django:project}

This will download SOLR and create an executable at bin/solr. The name of the script is the name of the section.

To test the setup run bin/solr fg and check the console output. By default this will run a Jetty server on port 8080. The SOLR instance is accessible in a browser at http://127.0.0.1:8080/solr/.

When SOLR is started the first time, django-haystack is invoked to create the SOLR schema: the same will happen (overwriting any existing schema) if you run bin/solr reset.

SOLR will write all its log files into var/solr/log. All its configuration including jobs and past runs will go into var/solr/data. The directory name in var will have the name of the recipe section.

Options

The recipe supports the following options:

eggs
Optional. The eggs the solr script should load. Since django-haystack is invoked, it must be atleast all the eggs that are necessary to run Django management commands.
django-settings
If your Django settings are in a module in sys.path, put here the module name. Either this or django-settings-file should be specified.
django-settings-file
If your Django settings are in a file not in sys.path, put here the file name. Either this or django-settings should be specified.
solr-location
The location of the part where the SOLR distribution has been downloaded.
solr-config
Optional. The file name containing the SOLR config (solrconfig.xml).
java-opts

Optional. Parameters to pass to the Java Virtual Machine (JVM) used to run Jetty. Each option is specified on a separated line. If you run into memory problems it's typical to pass:

[solr]
...
java-opts =
  -Xms512M
  -Xmx1024M
...
java-args
Optional. Extra arguments to pass to the Java Virtual Machine (JVM): this are typically all the parameters you'd pass after the jar file.
initialization
Optional chunk of code that is needed prior to Django bootstrapping.
environment-vars
Environment variables needed prior to Django bootstrapping.

Development

The code and issue tracker can be found at: https://github.com/abstract-open-solutions/abstract.recipe.haystack-solr

abstract.recipe.haystack-solr's People

Contributors

simonedeponti avatar silviot avatar

Watchers

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