11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

doc40=42<br />

The keys listed in this file do not need to be unique. The file does not need to be sorted, but <strong>Solr</strong> will be able to<br />

perform the lookup faster if it is.<br />

Reloading an External File<br />

It's possible to define an event listener to reload an external file when either a searcher is reloaded or when a<br />

new searcher is started. See the section Query-Related Listeners for more information, but a sample definition in<br />

solrconfig.xml might look like this:<br />

<br />

<br />

The PreAnalyzedField Type<br />

The PreAnalyzedField type provides a way to send to <strong>Solr</strong> serialized token streams, optionally with<br />

independent stored values of a field, and have this information stored and indexed without any additional text<br />

processing applied in <strong>Solr</strong>. This is useful if user wants to submit field content that was already processed by<br />

some existing external text processing pipeline (e.g., it has been tokenized, annotated, stemmed, synonyms<br />

inserted, etc.), while using all the rich attributes that Lucene's TokenStream provides (per-token attributes).<br />

The serialization format is pluggable using implementations of PreAnalyzedParser interface. There are two<br />

out-of-the-box implementations:<br />

JsonPreAnalyzedParser: as the name suggests, it parses content that uses JSON to represent field's<br />

content. This is the default parser to use if the field type is not configured otherwise.<br />

SimplePreAnalyzedParser: uses a simple strict plain text format, which in some situations may be easier<br />

to create than JSON.<br />

There is only one configuration parameter, parserImpl. The value of this parameter should be a fully qualified<br />

class name of a class that implements PreAnalyzedParser interface. The default value of this parameter is org.<br />

apache.solr.schema.JsonPreAnalyzedParser.<br />

By default, the query-time analyzer for fields of this type will be the same as the index-time analyzer, which<br />

expects serialized pre-analyzed text. You must add a query type analyzer to your fieldType in order to perform<br />

analysis on non-pre-analyzed queries. In the example below, the index-time analyzer expects the default JSON<br />

serialization format, and the query-time analyzer will employ StandardTokenizer/LowerCaseFilter:<br />

<br />

<br />

<br />

<br />

<br />

<br />

JsonPreAnalyzedParser<br />

This is the default serialization format used by PreAnalyzedField type. It uses a top-level JSON map with the<br />

following keys:<br />

Key Description Required?<br />

v Version key. Currently the supported version is 1.<br />

required<br />

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

62

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

Saved successfully!

Ooh no, something went wrong!