Skip to content

Instantly share code, notes, and snippets.

@ivv-private
Last active December 10, 2015 02:48
Show Gist options
  • Save ivv-private/4370155 to your computer and use it in GitHub Desktop.
Save ivv-private/4370155 to your computer and use it in GitHub Desktop.
begin
refresh_mviews;
end;
<dataConfig>
<dataSource driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:/temp/example/ex" user="sa" />
<function name="decode" class="solr.f.Decode"/>
<function name="load" class="solr.f.LoadQuery"/>
<function name="run" class="solr.f.RunQuery"/>
<document>
<entity
name="item"
query="${dataimporter.functions.load(
dataimporter.functions.decode(
dataimporter.request.clean,
'false', 'delta.sql',
'full.sql'))}">
<field column="ID" name="id" />
<field column="NAME" name="name" />
<field column="MANU" name="manu" />
<field column="WEIGHT" name="weight" />
<field column="PRICE" name="price" />
<field column="POPULARITY" name="popularity" />
<field column="INSTOCK" name="inStock" />
<field column="INCLUDES" name="includes" />
</entity>
</document>
</dataConfig>
select *
from
v_index_delta
where id in
(select id from t_item i
where (
'${dataimporter.request.id}' is null
and i.updated >= to_date(
'${dataimporter.last_index_time}', 'yyyy-mm-dd hh24:mi:ss')))
/* Run material views updating
${dataimporter.functions.run('before-full.sql')} */
select * from v_index_full
<entity name="item" pk="ID"
query="SELECT *
FROM v_index
WHERE '${dataimporter.request.clean}' != 'false'
OR id IN
(SELECT id
FROM t_item i
WHERE ('${dataimporter.request.id}' IS NULL
AND i.updated >= TO_DATE ('${dataimporter.last_index_time}', 'yyyy-mm-dd hh24:mi:ss')))">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment