You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by stockii <st...@googlemail.com> on 2014/10/02 16:19:09 UTC
DIH - cacheImpl="SortedMapBackedCache" - empty rows from sub entity
Hello
i am fighting with cacheImpl="SortedMapBackedCache".
I want to refactor my ugly entities and so i try out sub-entities with
caching.
My Problem is that my cached subquery do not return any values from the
select. but why?
thats my entity
<entity name="en1" pk="id" transformer="DateFormatTransformer"
query="SELECT id, product FROM table WHERE product = 'abc'">
<entity name="en2" pk="id" transformer="DateFormatTransformer"
cacheImpl="SortedMapBackedCache"
query=" SELECT id, code FROM table2"
where="id = '${en1.id}'"/>
</entity>
this is very fast an clear and nice... but it does not work. all from table2
is not coming to my index =(
BUT if i remove the line with "cacheImpl="SortedMapBackedCache" all data is
present, but every row is selecte each by each.
i thought that this construct, hopefully replace my ugly big join-query in a
single entity!?
--
View this message in context: http://lucene.472066.n3.nabble.com/DIH-cacheImpl-SortedMapBackedCache-empty-rows-from-sub-entity-tp4162316.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: DIH - cacheImpl="SortedMapBackedCache" - empty rows from sub
entity
Posted by stockii <st...@googlemail.com>.
i dont know why. but it works if i dont use cacheKey/cacheLookup. But if i
use "where" it works fine.
http://wiki.apache.org/solr/DataImportHandler#CachedSqlEntityProcessor -
>From Example 2:
where="id=en1.id" ... strange.
--
View this message in context: http://lucene.472066.n3.nabble.com/DIH-cacheImpl-SortedMapBackedCache-empty-rows-from-sub-entity-tp4162316p4162882.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: DIH - cacheImpl="SortedMapBackedCache" - empty rows from sub
entity
Posted by stockii <st...@googlemail.com>.
thx.
this is a little bit better, but now i got only one row from entity "en2" in
my index.
it seems, that the lookup dont work for me =((
--
View this message in context: http://lucene.472066.n3.nabble.com/DIH-cacheImpl-SortedMapBackedCache-empty-rows-from-sub-entity-tp4162316p4162879.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: DIH - cacheImpl="SortedMapBackedCache" - empty rows from sub
entity
Posted by "Dyer, James" <Ja...@ingramcontent.com>.
Try using the cacheKey/cacheLookup parameters instead:
<entity
name="en1"
pk="id"
transformer="DateFormatTransformer"
query="SELECT id, product FROM table WHERE product = 'abc'"
>
<entity
name="en2"
cacheKey="id"
cacheLookup="en1.id"
transformer="DateFormatTransformer"
cacheImpl="SortedMapBackedCache"
query="SELECT id, code FROM table2"
/>
</entity>
James Dyer
Ingram Content Group
(615) 213-4311
-----Original Message-----
From: stockii [mailto:stock.jonas@googlemail.com]
Sent: Thursday, October 02, 2014 9:19 AM
To: solr-user@lucene.apache.org
Subject: DIH - cacheImpl="SortedMapBackedCache" - empty rows from sub entity
Hello
i am fighting with cacheImpl="SortedMapBackedCache".
I want to refactor my ugly entities and so i try out sub-entities with
caching.
My Problem is that my cached subquery do not return any values from the
select. but why?
thats my entity
<entity name="en1" pk="id" transformer="DateFormatTransformer"
query="SELECT id, product FROM table WHERE product = 'abc'">
<entity name="en2" pk="id" transformer="DateFormatTransformer"
cacheImpl="SortedMapBackedCache"
query=" SELECT id, code FROM table2"
where="id = '${en1.id}'"/>
</entity>
this is very fast an clear and nice... but it does not work. all from table2
is not coming to my index =(
BUT if i remove the line with "cacheImpl="SortedMapBackedCache" all data is
present, but every row is selecte each by each.
i thought that this construct, hopefully replace my ugly big join-query in a
single entity!?
--
View this message in context: http://lucene.472066.n3.nabble.com/DIH-cacheImpl-SortedMapBackedCache-empty-rows-from-sub-entity-tp4162316.html
Sent from the Solr - User mailing list archive at Nabble.com.