[Erp5-report] r44381 ivan - in /erp5/trunk/bt5/erp5_km_sphinxse_full_text_search: SkinTempl...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Mar 17 12:34:43 CET 2011
Author: ivan
Date: Thu Mar 17 12:34:43 2011
New Revision: 44381
URL: http://svn.erp5.org?rev=44381&view=rev
Log:
Cosmetic changes.
Add script to determine owner's title.
Added:
erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/ERP5Site_getPersonMapAndUidList.xml
Modified:
erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/WebSite_zGetAdvancedSearchResultList.xml
erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/bt/revision
Added: erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/ERP5Site_getPersonMapAndUidList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/ERP5Site_getPersonMapAndUidList.xml?rev=44381&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/ERP5Site_getPersonMapAndUidList.xml (added)
+++ erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/ERP5Site_getPersonMapAndUidList.xml [utf8] Thu Mar 17 12:34:43 2011
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string>"""\n
+ Examine ERP5 Site return mapping between a \'reference\' and respective Person object\'s title.\n
+ This script is used in "No ZODB" approach to get fast search results.\n
+"""\n
+from Products.ERP5Type.Cache import CachingMethod\n
+\n
+def getPersonMapAndUidList():\n
+ result_dict = {}\n
+ kw[\'portal_type\'] = \'Person\'\n
+ kw[\'reference\'] = \'!=Null\'\n
+ person_list = context.portal_catalog(**kw)\n
+ for person in person_list:\n
+ person = person.getObject()\n
+ result_dict[person.getReference()] = {\'title\': person.getTitle(), \n
+ \'path\': person.getPath()}\n
+ return result_dict\n
+\n
+getPersonMapAndUidList = CachingMethod(getPersonMapAndUidList,\n
+ id = \'ERP5Site_getPersonMapAndUidList\',\n
+ cache_factory = \'erp5_content_medium\')\n
+return getPersonMapAndUidList()\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>**kw</string> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>ERP5Site_getPersonMapAndUidList</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/WebSite_zGetAdvancedSearchResultList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/WebSite_zGetAdvancedSearchResultList.xml?rev=44381&r1=44380&r2=44381&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/WebSite_zGetAdvancedSearchResultList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/SkinTemplateItem/portal_skins/erp5_km_sphinxse_full_text_search/WebSite_zGetAdvancedSearchResultList.xml [utf8] Thu Mar 17 12:34:43 2011
@@ -87,10 +87,10 @@ SELECT catalog.uid, \n
catalog.reference, \n
catalog.modification_date,\n
catalog.owner,\n
- <dtml-if is_full_text_search_on> text, </dtml-if>\n
- category_uid,\n
- base_category_uid,\n
- category_relative_url,\n
+ <dtml-if is_full_text_search_on> search_results.text, </dtml-if>\n
+ join_category.category_uid,\n
+ join_category.base_category_uid,\n
+ join_category.category_relative_url,\n
versioning.version,\n
versioning.language\n
\n
@@ -100,10 +100,10 @@ FROM catalog,\n
<dtml-if is_full_text_search_on>\n
<dtml-if use_text_excerpts>\n
/* MySQL server can produc text excerpts */\n
- , sphinx_snippets(full_text.SearchableText, \'erp5\', \'<dtml-var "search_string">\') as text\n
+ , sphinx_snippets(full_text.SearchableText, \'erp5\', \'<dtml-var "search_string">\') AS text\n
<dtml-else>\n
/* Return all searchable text to server which will extract found text excerpts */\n
- , full_text.SearchableText as text\n
+ , full_text.SearchableText AS text\n
</dtml-if>\n
</dtml-if>\n
<dtml-if "query[\'select_expression\']">\n
@@ -125,13 +125,13 @@ FROM catalog,\n
<dtml-else> LIMIT 1000 </dtml-if>) \n
\n
AS search_results LEFT JOIN \n
- (SELECT category.uid as join_category_uid, \n
+ (SELECT category.uid AS join_category_uid, \n
category.base_category_uid AS base_category_uid,\n
category.category_uid AS category_uid,\n
- catalog.relative_url as category_relative_url\n
+ catalog.relative_url AS category_relative_url\n
FROM category, catalog\n
WHERE category.category_strict_membership = 1\n
- and category.base_category_uid in \n
+ AND category.base_category_uid IN \n
(<dtml-in prefix="loop" expr="base_category_uid_list">\n
<dtml-if sequence-end>\n
<dtml-sqlvar expr="loop_item" type="int">\n
@@ -139,12 +139,12 @@ FROM catalog,\n
<dtml-sqlvar expr="loop_item" type="int">,\n
</dtml-if>\n
</dtml-in>)\n
- and category.category_uid = catalog.uid\n
+ AND category.category_uid = catalog.uid\n
\n
) AS join_category\n
ON search_results.uid = join_category.join_category_uid\n
\n
-WHERE search_results.uid = catalog.uid and versioning.uid = catalog.uid\n
+WHERE search_results.uid = catalog.uid AND versioning.uid = catalog.uid\n
\n
</dtml-let>
Modified: erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/bt/revision?rev=44381&r1=44380&r2=44381&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_km_sphinxse_full_text_search/bt/revision [utf8] Thu Mar 17 12:34:43 2011
@@ -1 +1 @@
-13
\ No newline at end of file
+14
\ No newline at end of file
More information about the Erp5-report
mailing list