lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mechravi25 <mechrav...@yahoo.co.in>
Subject Query in CachedSQLEntityProcessor
Date Fri, 19 Oct 2012 11:15:00 GMT
Hi,

I am using solr 3.6.1 version.


Following is the way is index dcouments. MY DIH file looks like this

         <entity name="e1" dataSource="ds1" 
                query="select id,name from table1 where type='abc'"
transformer="RegexTransformer,DateFormatTransformer,TemplateTransformer">
                	<field column="name" name="name"/>
                        <field column="id" name="id"/>
          
          <entity name="e2" dataSource="ds1" 
          query="select id,name1, value from table2 where ObjectType='abc'" 
          processor="CachedSqlEntityProcessor" cacheKey="id"
cacheLookup="e1.id"
transformer="RegexTransformer,DateFormatTransformer,TemplateTransformer">
                                <field column="value" name="${e1.name1}"/>
                </entity>

	</entity>
In the second entity query, the value field varies for each id and my
understanding of CachedSQLEntityProcessor 
is that the data will be fetched for both parent and child entity and stored
in cache and then using the cacheKey and cachelookup 
the values will be indexed properly for each id. So far the indexing happens
fine.


This is how my indexed data looks like
<doc>
  <str name="id">1</str> 
- <arr name="Name">
  <str>ABC</str> 
  </arr>
 </doc>
 
<doc> 
 <str name="id">2</str> 
- <arr name="Name">
  <str>DEF</str> 
  </arr>


</doc>


Now I add another child entity and the value field is constant and has to be
indexed for all the id's for that particular type




<entity name="e3" dataSource="ds1" query="select name1, 
'' as value from table3 where type='abc' "
processor="CachedSqlEntityProcessor" cacheLookup="object.uid"
transformer="RegexTransformer,DateFormatTransformer,TemplateTransformer">
                                <field column="value" name="${e3.name1}"/>
                </entity>  
                
                
                
                
 Again the indexing happens as I want it to and the indexed document looks
like. 
 
 
 <doc>
   <str name="id">1</str> 
 - <arr name="Name">
   <str>ABC</str> 
   </arr>
   <arr name="Name1">
     <str /> 
     </arr>
</doc>
<doc>
  <str name="id">2</str> 
 - <arr name="Name">
   <str>DEF</str> 
   </arr>
 <arr name="Name1">
   <str /> 
   </arr>

 
</doc>
 
 
 
 
I just need to know if my understanding of how the thing works is correct.

Is it like the entity e3 is run, the result is stored in cache and then
since no cachekey value is given in the entity query , the result from
entity 3 is getting indexed for all the id's? Is my understanding correct?
In that case there wont be a need for cacheLookUp in entity e3 right? 

Note: The total requests made to data source was 3.


Please tell me if my understanding is right with regards to the above
explained scenario otherwise kindly tell me what exactly happens in this
scenario.

Thanks in advance.




--
View this message in context: http://lucene.472066.n3.nabble.com/Query-in-CachedSQLEntityProcessor-tp4014731.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message