Commit 142edb03 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Don't insert in full_text table if there are no SearchableText

same as 4c129961.
parent 291fafc5
......@@ -55,20 +55,31 @@ SearchableText</string> </value>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
REPLACE INTO\n
DELETE FROM\n
full_text\n
WHERE\n
<dtml-in uid>\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
<dtml-var "\'\\0\'"><dtml-let document_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "SearchableText[loop_item]">\n
<dtml-call expr="document_list.append(loop_item)">\n
</dtml-if>\n
</dtml-in>\n
<dtml-if expr="_.len(document_list) > 0">\n
INSERT INTO\n
full_text\n
VALUES\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
(\n
<dtml-sqlvar expr="uid[loop_item]" type="int">, \n
<dtml-in prefix="loop" expr="document_list">\n
( \n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="SearchableText[loop_item]" type="string" optional>\n
)\n
<dtml-if sequence-end>\n
<dtml-else>\n
,\n
</dtml-if>\n
</dtml-in>\n
)<dtml-unless sequence-end>,</dtml-unless>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>
]]></string> </value>
</item>
......
3
\ No newline at end of file
4
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment