Skip to content
This repository has been archived by the owner on Mar 1, 2020. It is now read-only.

ChrisMacNaughton/solr-jetty

Repository files navigation

Juju charm solr-jetty

Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, and a web administration interface. This charm deploys Solr in the Java servlet container Jetty.

This charm is designed to be deployed as the backend to a second charm, its interface should not be exposed directly as there are no controls over who can update the stored data.

How to deploy the charm

juju deploy solr-jetty

How to configure the charm

Load custom solr schema

juju set solr-jetty "schema=$(base64 < my-schema.xml)"

Set number of Jetty acceptors

juju set solr-jetty "acceptors=20"

Explicitly set JVM min heap and max heap size

juju set solr-jetty java-min-heap-mb=256 java-max-heap-mb=512

Add storage devices

juju set solr-jetty volume-map="{solr-jetty/0: /dev/vdb}" volume-ephemeral=false

Add Ceph storage device

juju set solr-jetty volume-map="{solr-jetty/0: /dev/rbd/solr-jetty/solr}" volume-ephemeral=false juju add-relation solr-jetty ceph

Loading the example mem.xml from apache-solr-1.4.1.tgz

curl http://:8080/solr/update --data-binary @mem.xml -H 'Content-type:text/xml; charset=utf-8' curl http://:8080/solr/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'

... and querying it

curl http://:8080/solr/select?q=memory

Example:

Define schema

echo '

<fields>
    <field name="id" type="string" indexed="true" stored="true" required="true" /> 
    <field name="name" type="string" indexed="true" stored="true"/>
    <field name="description" type="textgen" indexed="true" stored="true" default="" /> 
</fields>

<uniqueKey>id</uniqueKey>
<defaultSearchField>description</defaultSearchField>

' > snack-schema.xml

Load schema

juju set solr-jetty "schema=$(base64 < snack-schema.xml)"

Define data

echo ' 1 Chococapers Delicious caper flavoured chocolate snack 2 Chillimilk All the goodness of milk with a chilli twist 3 Caperyogurt Thick yogurt infused with caper goodness ' > snack-data.xml

Loading the snack data

curl http://:8080/solr/update --data-binary @snack-data.xml -H 'Content-type:text/xml; charset=utf-8' curl http://:8080/solr/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'

You're craving capers but what snack will satisfy you?

curl 'http://:8080/solr/select?q=caper'

TODO

  • Deploy Solr 4.x
    • Deploy with Solr Cloud
    • Manage cluster config within Zookeeper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •