Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ sunspot_rails/spec/rails3/vendor
sunspot-solr.pid
.yardoc
docs
sunspot_solr/solr/solr-webapp
.DS_Store
2 changes: 1 addition & 1 deletion sunspot_solr/lib/sunspot/solr/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize(solr_home, options)
end

def execute
ConfigInstaller.execute(File.join(@solr_home, 'conf'), @options)
ConfigInstaller.execute(File.join(@solr_home, 'core_default','conf'), @options)
end
end
end
Expand Down
10 changes: 9 additions & 1 deletion sunspot_solr/lib/sunspot/solr/installer/config_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def initialize(config_path, options)

def execute
sunspot_config_path = File.join(File.dirname(__FILE__), '..', '..',
'..', '..', 'solr', 'solr', 'conf')
'..', '..', 'solr', 'solr', 'core_default','conf')
return if File.expand_path(sunspot_config_path) == File.expand_path(@config_path)

FileUtils.mkdir_p(@config_path)
Expand All @@ -38,7 +38,15 @@ def execute

say("Copying #{file} => #{dest}")
FileUtils.cp(file, dest)


end

solr4_xml_file = File.join(File.dirname(__FILE__), '..', '..',
'..', '..', 'solr', 'solr', 'solr.xml')
solr4_dest_dir = File.join(FileUtils.pwd, 'solr')
say("Copying #{solr4_xml_file} => #{solr4_dest_dir}")
FileUtils.cp(solr4_xml_file, solr4_dest_dir)
end
end
end
Expand Down
74 changes: 57 additions & 17 deletions sunspot_solr/solr/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,70 @@
# See the License for the specific language governing permissions and
# limitations under the License.

Solr example configuration
--------------------------
Solr example
------------

This directory contains an instance of the Jetty Servlet container setup to
run Solr using an example configuration.

To run this example configuration, use
To run this example:

java -jar start.jar

in this directory, and when Solr is started connect to
in this example directory, and when Solr is started connect to

http://localhost:8983/solr/

To add documents to the index, use the post.jar (or post.sh script) in
the example/exampledocs subdirectory (while Solr is running), for example:

cd exampledocs
java -jar post.jar *.xml
Or: sh post.sh *.xml

For more information about this example please read...

* example/solr/README.txt
For more information about the "Solr Home" and Solr specific configuration
* http://lucene.apache.org/solr/tutorial.html
For a Tutorial using this example configuration
* http://wiki.apache.org/solr/SolrResources
For a list of other tutorials and introductory articles.

Notes About These Examples
--------------------------

* SolrHome *

By default, start.jar starts Solr in Jetty using the default Solr Home
directory of "./solr/" (relative to the working directory of hte servlet
container). To run other example configurations, you can specify the
solr.solr.home system property when starting jetty...

java -Dsolr.solr.home=multicore -jar start.jar
java -Dsolr.solr.home=example-DIH/solr -jar start.jar

* References to Jar Files Outside This Directory *

http://localhost:8983/solr/admin/
Various example SolrHome dirs contained in this directory may use "<lib>"
statements in the solrconfig.xml file to reference plugin jars outside of
this directory for loading "contrib" plugins via relative paths.

To add documents to the index, use the post.sh script in the exampledocs
subdirectory (while Solr is running), for example:
If you make a copy of this example server and wish to use the
ExtractingRequestHandler (SolrCell), DataImportHandler (DIH), UIMA, the
clustering component, or any other modules in "contrib", you will need to
copy the required jars or update the paths to those jars in your
solrconfig.xml.

cd exampledocs
./post.sh *.xml
* Logging *

See also README.txt in the solr subdirectory, and check
http://wiki.apache.org/solr/SolrResources for a list of tutorials and
introductory articles.
By default, Jetty & Solr will log to the console. This can be convenient when
first getting started, but eventually you will want to log to a file. To
configure logging, you can just pass a system property to Jetty on startup:

NOTE: This Solr example server references SolrCell jars outside of the server
directory with <lib> statements in the solrconfig.xml. If you make a copy of
this example server and wish to use the ExtractingRequestHandler (SolrCell),
you will need to copy the required jars into solr/lib or update the paths to
the jars in your solrconfig.xml.
java -Djava.util.logging.config.file=etc/logging.properties -jar start.jar
This will use Java Util Logging to log to a file based on the config in
etc/logging.properties. Logs will be written in the logs directory. It is
also possible to setup log4j or other popular logging frameworks.

8 changes: 8 additions & 0 deletions sunspot_solr/solr/contexts/solr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/solr</Set>
<Set name="war"><SystemProperty name="jetty.home"/>/webapps/solr.war</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home"/>/etc/webdefault.xml</Set>
<Set name="tempDirectory"><Property name="jetty.home" default="."/>/solr-webapp</Set>
</Configure>
Loading