You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2020/10/21 11:39:50 UTC

[lucene-solr] branch branch_8x updated: SOLR-14445: Add Entity Caching documentation (#2013)

This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 32c0746  SOLR-14445: Add Entity Caching documentation (#2013)
32c0746 is described below

commit 32c0746d9083981b3bb9dcb9be9a422e9f3cd8c3
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Wed Oct 21 13:38:54 2020 +0200

    SOLR-14445: Add Entity Caching documentation (#2013)
    
    Signed-off-by: Jan Høydahl <ja...@apache.org>
    
    Co-authored-by: Tobias Kässmann <to...@mondia.com>
---
 ...ading-structured-data-store-data-with-the-data-import-handler.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/solr/solr-ref-guide/src/uploading-structured-data-store-data-with-the-data-import-handler.adoc b/solr/solr-ref-guide/src/uploading-structured-data-store-data-with-the-data-import-handler.adoc
index 24160c7..86fd4cd 100644
--- a/solr/solr-ref-guide/src/uploading-structured-data-store-data-with-the-data-import-handler.adoc
+++ b/solr/solr-ref-guide/src/uploading-structured-data-store-data-with-the-data-import-handler.adoc
@@ -425,7 +425,7 @@ join="zipper"::
 Enables merge join, aka "zipper" algorithm, for joining parent and child entities without cache. It should be specified at child (nested) `<entity>`. It implies that parent and child queries return results ordered by keys, otherwise it throws an exception. Keys should be specified either with `where` attribute or with `cacheKey` and `cacheLookup`.
 
 === Entity Caching
-Caching of entities in DIH is provided to avoid repeated lookups for same entities again and again. The default `SortedMapBackedCache` is a `HashMap` where a key is a field in the row and the value is a bunch of rows for that same key.
+Caching of entities in DIH is provided to avoid repeated lookups for same entities again and again. The default `SortedMapBackedCache` is a `HashMap` where a key is a field in the row and the value is a bunch of rows for that same key. It's also possible to use different datasources for the entities by setting the `datasource` attribute.
 
 In the example below, each `manufacturer` entity is cached using the `id` property as a cache key. Cache lookups will be performed for each `product` entity based on the product's `manu` property. When the cache has no data for a particular key, the query is run and the cache is populated
 
@@ -437,6 +437,8 @@ In the example below, each `manufacturer` entity is cached using the `id` proper
 </entity>
 ----
 
+CAUTION: Note that the `cacheKey` and the `cacheLookup` key must have the same type. This could be forced by adding casts to your sql.
+
 === The SQL Entity Processor
 
 The SqlEntityProcessor is the default processor. The associated <<JdbcDataSource>> should be a JDBC URL.