11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If the field name is defined in the Schema that is associated with the index, then the analysis steps associated<br />

with that field will be applied to its content when the content is tokenized. Fields that are not explicitly defined in<br />

the Schema will either be ignored or mapped to a dynamic field definition (see Documents, Fields, and Schema<br />

Design), if one matching the field name exists.<br />

For more information on indexing in <strong>Solr</strong>, see the <strong>Solr</strong> Wiki.<br />

The <strong>Solr</strong> Example Directory<br />

When starting <strong>Solr</strong> with the "-e" option, the example/ directory will be used as base directory for the example<br />

<strong>Solr</strong> instances that are created. This directory also includes an example/exampledocs/ subdirectory<br />

containing sample documents in a variety of formats that you can use to experiment with indexing into the<br />

various examples.<br />

The curl Utility for Transferring Files<br />

Many of the instructions and examples in this section make use of the curl utility for transferring content<br />

through a URL. curl posts and retrieves data over HTTP, FTP, and many other protocols. Most Linux<br />

distributions include a copy of curl. You'll find curl downloads for Linux, Windows, and many other operating<br />

systems at http://curl.haxx.se/download.html. Documentation for curl is available here: http://curl.haxx.se/docs/<br />

manpage.html.<br />

Using curl or other command line tools for posting data is just fine for examples or tests, but it's not the<br />

recommended method for achieving the best performance for updates in production environments. You<br />

will achieve better performance with <strong>Solr</strong> Cell or the other methods described in this section.<br />

Instead of curl, you can use utilities such as GNU wget ( http://www.gnu.org/software/wget/ ) or manage<br />

GETs and POSTS with Perl, although the command line options will differ.<br />

Post Tool<br />

<strong>Solr</strong> includes a simple command line tool for POSTing various types of content to a <strong>Solr</strong> server. The tool is bin/<br />

post. The bin/post tool is a Unix shell script; for Windows (non-Cygwin) usage, see the Windows section below.<br />

To run it, open a window and enter:<br />

bin/post -c gettingstarted example/films/films.json<br />

This will contact the server at localhost:8983. Specifying the collection/core name is mandatory. The<br />

'-help' (or simply '-h') option will output information on its usage (i.e., bin/post -help).<br />

Using the bin/post Tool<br />

Specifying either the collection/core name or the full update url is mandatory when using bin/post.<br />

The basic usage of bin/post is:<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

180

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!