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.

cacheImpl Optional. A class (which must implement DIHCache) to use for caching this entity<br />

when doing lookups from an entity which wraps it. Provided implementation is "Sort<br />

edMapBackedCache".<br />

cacheKey The name of a property of this entity to use as a cache key if cacheImpl is<br />

specified.<br />

cacheLookup<br />

An entity + property name that will be used to lookup cached instances of this entity<br />

if cacheImpl is specified.<br />

where an alternative way to specify cacheKey and cacheLookup concatenated with '='.<br />

eg where="CODE=People.COUNTRY_CODE" is equal to cacheKey="CODE"<br />

cacheLookup="People.COUNTRY_CODE"<br />

child="true" Enables indexing document blocks aka Nested Child Documents for searching with<br />

Block Join Query Parsers . It can be only specified on under another root<br />

entity. It switches from default behavior (merging field values) to nesting documents<br />

as children documents. Note: parent should add a field which is used as<br />

a parent filter in query time.<br />

join="zipper"<br />

Enables merge join aka "zipper" algorithm for joining parent and child entities without<br />

cache. It should be specified at child (nested) . It implies that parent and<br />

child queries return results ordered by keys, otherwise it throws an exception. Keys<br />

should be specified either with where attribute or with cacheKey and cacheLooku<br />

p.<br />

Caching of entities in DIH is provided to avoid repeated lookups for same entities again and again. The default S<br />

ortedMapBackedCache is a HashMap where a key is a field in the row and the value is a bunch of rows for that<br />

same key.<br />

In the example below, each manufacturer entity is cached using the ' id' property as a cache key. Cache<br />

lookups will be performed for each product entity based on the product's " manu" property. When the cache has<br />

no data for a particular key, the query is run and the cache is populated<br />

<br />

<br />

<br />

The SQL Entity Processor<br />

The SqlEntityProcessor is the default processor. The associated data source should be a JDBC URL.<br />

The entity attributes specific to this processor are shown in the table below.<br />

Attribute<br />

query<br />

deltaQuery<br />

parentDeltaQuery<br />

Use<br />

Required. The SQL query used to select rows.<br />

SQL query used if the operation is delta-import. This query selects the primary keys of the<br />

rows which will be parts of the delta-update. The pks will be available to the<br />

deltaImportQuery through the variable ${dataimporter.delta. }.<br />

SQL query used if the operation is delta-import.<br />

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

214

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

Saved successfully!

Ooh no, something went wrong!