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 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -82,7 +79,10 @@ def getRandomDocumentTextExcerpt(document_text):\n ...@@ -82,7 +79,10 @@ def getRandomDocumentTextExcerpt(document_text):\n
\n \n
if document_text is None:\n if document_text is None:\n
try:\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 except NotConvertedError:\n
return context.Base_translateString("This document is not converted yet.")\n return context.Base_translateString("This document is not converted yet.")\n
\n \n
...@@ -161,11 +161,14 @@ else:\n ...@@ -161,11 +161,14 @@ else:\n
<string>is_gadget_mode</string> <string>is_gadget_mode</string>
<string>getRandomDocumentTextExcerpt</string> <string>getRandomDocumentTextExcerpt</string>
<string>None</string> <string>None</string>
<string>getattr</string>
<string>isinstance</string>
<string>str</string>
<string>unicode</string>
<string>search_string</string> <string>search_string</string>
<string>search_argument_list</string> <string>search_argument_list</string>
<string>found_text_fragments</string> <string>found_text_fragments</string>
<string>map</string> <string>map</string>
<string>str</string>
<string>result</string> <string>result</string>
<string>unicode_result</string> <string>unicode_result</string>
</tuple> </tuple>
......
1697 1698
\ No newline at end of file \ 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