[Erp5-report] r43276 kazuhiko - in /erp5/trunk/bt5/erp5_full_text_sphinxse_catalog: Catalog...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 10 16:08:17 CET 2011


Author: kazuhiko
Date: Thu Feb 10 16:08:17 2011
New Revision: 43276

URL: http://svn.erp5.org?rev=43276&view=rev
Log:
2011-02-10 Kazuhiko
* add one more 'uid' column in z_catalog_sphinxse_index_list and add ERP5Site_checkSphinxSE script that cheks if all documents having SearchableText are well indexed in SphinxSE.

Added:
    erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_checkSphinxSE.xml
Modified:
    erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_sphinxse_index_list.xml
    erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/change_log
    erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision

Modified: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_sphinxse_index_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_sphinxse_index_list.xml?rev=43276&r1=43275&r2=43276&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_sphinxse_index_list.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_sphinxse_index_list.xml [utf8] Thu Feb 10 16:08:17 2011
@@ -64,7 +64,8 @@ VALUES\n
 <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
 (\n
   <dtml-sqlvar expr="uid[loop_item]" type="int">,\n
-  <dtml-sqlvar expr="(SearchableText[loop_item] or \'\')" type="string">\n
+  <dtml-sqlvar expr="(SearchableText[loop_item] or \'\')" type="string">,\n
+  <dtml-sqlvar expr="uid[loop_item]" type="int">\n
 )\n
 <dtml-if sequence-end>\n
 <dtml-else>\n

Added: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_checkSphinxSE.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_checkSphinxSE.xml?rev=43276&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_checkSphinxSE.xml (added)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_checkSphinxSE.xml [utf8] Thu Feb 10 16:08:17 2011
@@ -0,0 +1,89 @@
+<?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>portal = context.getPortalObject()\n
+portal_catalog = portal.portal_catalog\n
+connection = portal.erp5_sql_connection\n
+sql_catalog = portal_catalog.getSQLCatalog(sql_catalog_id)\n
+LIMIT = 100\n
+\n
+missing_uid_list = []\n
+i = 0\n
+while True:\n
+  full_text_list = portal_catalog(SearchableText=\'!=NULL\', limit=(i*LIMIT, LIMIT))\n
+  i += 1\n
+  len1 = len(full_text_list)\n
+  if len1 == 0:\n
+    break\n
+  uid_list1 = [str(x.uid) for x in full_text_list]\n
+  result = connection.manage_test(\'select uid from sphinxse_index where \'\n
+                                  \'sphinxse_query=\\\'filter=uid,%s;limit=%s\\\'\' % (\',\'.join(uid_list1), LIMIT))\n
+  if len(result) == len1:\n
+    continue\n
+  uid_list2 = [str(x[0]) for x in result]\n
+  missing_uid_list += [x for x in uid_list1 if x not in uid_list2]\n
+if missing_uid_list:\n
+  return [(x.uid, x.path) for x in portal_catalog(uid=missing_uid_list)]\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>sql_catalog_id=None</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_checkSphinxSE</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/change_log?rev=43276&r1=43275&r2=43276&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/change_log [utf8] Thu Feb 10 16:08:17 2011
@@ -1,3 +1,6 @@
+2011-02-10 Kazuhiko
+* add one more 'uid' column in z_catalog_sphinxse_index_list and add ERP5Site_checkSphinxSE script that cheks if all documents having SearchableText are well indexed in SphinxSE.
+
 2011-01-28 Ivan
 * Define Sphinx's full_text key implementation.
 

Modified: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision?rev=43276&r1=43275&r2=43276&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision [utf8] Thu Feb 10 16:08:17 2011
@@ -1 +1 @@
-22
\ No newline at end of file
+23
\ No newline at end of file



More information about the Erp5-report mailing list