Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "DataImportHandler" page has been changed by NoblePaul. http://wiki.apache.org/solr/DataImportHandler?action=diff&rev1=236&rev2=237 -------------------------------------------------- Example 2: {{{ <entity name="x" query="select * from x"> - <entity name="y" query="select * from y" processor="CachedSqlEntityProcessor" where="xid=x.id"> + <entity name="y" query="select f_key, field1, field2 from y" processor="CachedSqlEntityProcessor" cacheKey="f_key" cacheLookup="x.id" > </entity> <entity> }}} - The difference with the previous one is the 'where' attribute. In this case the query fetches all the rows from the table and stores all the rows in the cache. The magic is in the 'where' value. The cache stores the values with the 'xid' value in 'y' as the key. The value for 'x.id' is evaluated every time the entity has to be run and the value is looked up in the cache an the rows are returned. + The difference with the previous one are the 'cacheKey' and 'cacheLookup' attributes. In this case the query is run and the rows fetched from the table is stored in a cache with the 'f_key' value as the key. The value for 'x.id' ('cacheLookup' attribute) is evaluated every time the entity has to be run and the value is looked up in the cache an the rows are returned. - In the where the lhs (the part before '=') is the column in y and the rhs (the part after '=') is the value to be computed for looking up the cache. + The advantage is that the query is run only once for the entity 'y' . Ensure that you have enough RAM to hold the data for all the rows fetched by the query === PlainTextEntityProcessor === <<Anchor(plaintext)>>
