Commit 19941fe9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

if SearchableText is joinned as it is, we use it for better performance.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38267 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 181036c9
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
......@@ -82,7 +79,10 @@ def getRandomDocumentTextExcerpt(document_text):\n
\n
if document_text is None:\n
try:\n
document_text = context.getSearchableText()\n
# if SearchableText is joinned as it is, we use it for better performance.\n
document_text = getattr(context, \'SearchableText\', None)\n
if not isinstance(document_text, (str, unicode)):\n
document_text = context.getSearchableText()\n
except NotConvertedError:\n
return context.Base_translateString("This document is not converted yet.")\n
\n
......@@ -161,11 +161,14 @@ else:\n
<string>is_gadget_mode</string>
<string>getRandomDocumentTextExcerpt</string>
<string>None</string>
<string>getattr</string>
<string>isinstance</string>
<string>str</string>
<string>unicode</string>
<string>search_string</string>
<string>search_argument_list</string>
<string>found_text_fragments</string>
<string>map</string>
<string>str</string>
<string>result</string>
<string>unicode_result</string>
</tuple>
......
1697
\ No newline at end of file
1698
\ 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