Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
9fda5829
Commit
9fda5829
authored
Apr 05, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make erp5_full_text_sphinxse_catalog more consistent with erp5_full_text_myisam_catalog.
parent
7c0c216d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
48 deletions
+26
-48
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.catalog_keys.xml
...sql_innodb/SQLCatalog_deferFullTextIndex.catalog_keys.xml
+0
-0
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.xml
...talog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.xml
+4
-5
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.catalog_keys.xml
...db/SQLCatalog_deferFullTextIndexActivity.catalog_keys.xml
+0
-0
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.xml
...p5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.xml
+19
-37
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_fulltext_list.catalog_keys.xml
...rp5_mysql_innodb/z_catalog_fulltext_list.catalog_keys.xml
+0
-3
bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_reindexSphinxSE.xml
...m/portal_skins/erp5_sphinxse/ERP5Site_reindexSphinxSE.xml
+1
-1
bt5/erp5_full_text_sphinxse_catalog/bt/template_catalog_method_id_list
..._text_sphinxse_catalog/bt/template_catalog_method_id_list
+2
-2
No files found.
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_defer
SphinxSEIndexing
.catalog_keys.xml
→
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_defer
FullTextIndex
.catalog_keys.xml
View file @
9fda5829
File moved
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_defer
SphinxSEIndexing
.xml
→
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_defer
FullTextIndex
.xml
View file @
9fda5829
...
@@ -50,10 +50,9 @@
...
@@ -50,10 +50,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# This script is called to separate SphinxSE indexing into a low-priority active object,\n
<value>
<string>
# This script is called to defer fulltext indexing in a lower priority.\n
# so that the important part can be finished quickly and also to serialise it because\n
# Activities are serialised because concurrent write may cause crash of searchd.\n
# concurrent write may cause crash of searchd.\n
context.activate(activity=\'SQLQueue\', priority=4, serialization_tag=\'sphinxse_indexing\').SQLCatalog_deferFullTextIndexActivity(path_list=list(getPath))\n
context.activate(activity=\'SQLQueue\', priority=3, serialization_tag=\'sphinxse_indexing\').SQLCatalog_catalogSphinxSE(getPath=getPath)\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
@@ -62,7 +61,7 @@ context.activate(activity=\'SQLQueue\', priority=3, serialization_tag=\'sphinxse
...
@@ -62,7 +61,7 @@ context.activate(activity=\'SQLQueue\', priority=3, serialization_tag=\'sphinxse
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SQLCatalog_defer
SphinxSEIndexing
</string>
</value>
<value>
<string>
SQLCatalog_defer
FullTextIndex
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_
catalogSphinxSE
.catalog_keys.xml
→
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_
deferFullTextIndexActivity
.catalog_keys.xml
View file @
9fda5829
File moved
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_
catalogSphinxSE
.xml
→
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_
deferFullTextIndexActivity
.xml
View file @
9fda5829
...
@@ -52,34 +52,20 @@
...
@@ -52,34 +52,20 @@
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ERP5Type.Utils import UpperCase\n
<value>
<string>
from Products.ERP5Type.Utils import UpperCase\n
from ZODB.POSException import ConflictError\n
from ZODB.POSException import ConflictError\n
from zExceptions import Unauthorized\n
\n
\n
# Retrieves SearchableText from catalog\n
method = context.z_catalog_fulltext_list\n
method = context.z_catalog_sphinxse_index_list\n
method2 = context.z_catalog_sphinxse_index_list\n
parameter_dict = {\'uid\':[], \'SearchableText\':[]}\n
for i in context.getPortalObject().portal_catalog(path=getPath, select_expression=\'SearchableText\'):\n
for property in (\'uid\', \'SearchableText\'):\n
parameter_dict[property].append(getattr(i, property))\n
if len(parameter_dict[\'uid\']):\n
return method(**parameter_dict)\n
return\n
\n
# the following is the alternate version that fails in case of errors (eg. NotConvertedError).\n
# if we separate updating full_text table activities too, we can consider using this one.\n
\n
# Obtain the properties from the Z SQL Method itself, as like catalogObjectList.\n
method = context.z_catalog_sphinxse_index_list\n
property_list = method.arguments_src.split()\n
property_list = method.arguments_src.split()\n
\n
# This below emulates what catalogObjectList is doing.\n
portal = context.getPortalObject()\n
document_type_list = portal.getPortalDocumentTypeList()\n
parameter_dict = {}\n
parameter_dict = {}\n
failed_path_list = []\n
failed_path_list = []\n
for path in getPath:\n
restrictedTraverse = context.getPortalObject().restrictedTraverse\n
obj = portal.restrictedTraverse(path, None)\n
for path in path_list:\n
if not path: # should happen in tricky testERP5Catalog tests only \n
continue\n
obj = restrictedTraverse(path, None)\n
if obj is None:\n
if obj is None:\n
continue\n
continue\n
\n
try:\n
try:\n
tmp_dict = {}\n
tmp_dict = {}\n
for property in property_list:\n
for property in property_list:\n
...
@@ -90,7 +76,10 @@ for path in getPath:\n
...
@@ -90,7 +76,10 @@ for path in getPath:\n
tmp_dict[property] = value\n
tmp_dict[property] = value\n
except ConflictError:\n
except ConflictError:\n
raise\n
raise\n
except:\n
except Unauthorized: # should happen in tricky testERP5Catalog tests only \n
continue\n
except Exception, e:\n
exception = e\n
failed_path_list.append(path)\n
failed_path_list.append(path)\n
else:\n
else:\n
for property, value in tmp_dict.items():\n
for property, value in tmp_dict.items():\n
...
@@ -99,30 +88,23 @@ for path in getPath:\n
...
@@ -99,30 +88,23 @@ for path in getPath:\n
if len(failed_path_list):\n
if len(failed_path_list):\n
if len(parameter_dict):\n
if len(parameter_dict):\n
# reregister activity for failed objects only\n
# reregister activity for failed objects only\n
context.activate(activity=\'SQLQueue\', priority=5, serialization_tag=\'sphinxse_indexing\').SQLCatalog_
catalogSphinxSE(getPath
=failed_path_list)\n
context.activate(activity=\'SQLQueue\', priority=5, serialization_tag=\'sphinxse_indexing\').SQLCatalog_
deferFullTextIndexActivity(path_list
=failed_path_list)\n
else:\n
else:\n
# if all objects are failed one, just raise an exception to avoid infinite loop.\n
# if all objects are failed one, just raise an exception to avoid infinite loop.\n
raise AttributeError, \'exception
raised in indexing %r\' % failed_path_list
\n
raise AttributeError, \'exception
%r raised in indexing %r\' % (exception, failed_path_list)
\n
\n
\n
if len(parameter_dict):\n
if parameter_dict:\n
return method(**parameter_dict)\n
method(**parameter_dict)\n
method2(**parameter_dict)\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
getPath
</string>
</value>
<value>
<string>
path_list
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SQLCatalog_
catalogSphinxSE
</string>
</value>
<value>
<string>
SQLCatalog_
deferFullTextIndexActivity
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_fulltext_list.catalog_keys.xml
View file @
9fda5829
<catalog_method>
<catalog_method>
<item
key=
"sql_catalog_object_list"
type=
"int"
>
<value>
1
</value>
</item>
</catalog_method>
</catalog_method>
bt5/erp5_full_text_sphinxse_catalog/SkinTemplateItem/portal_skins/erp5_sphinxse/ERP5Site_reindexSphinxSE.xml
View file @
9fda5829
...
@@ -60,7 +60,7 @@ while True:\n
...
@@ -60,7 +60,7 @@ while True:\n
full_text_list = portal_catalog(limit=(i*LIMIT, LIMIT))\n
full_text_list = portal_catalog(limit=(i*LIMIT, LIMIT))\n
if len(full_text_list) == 0:\n
if len(full_text_list) == 0:\n
break\n
break\n
sql_catalog.SQLCatalog_defer
SphinxSEIndexing
(getPath=[x.path for x in full_text_list])\n
sql_catalog.SQLCatalog_defer
FullTextIndex
(getPath=[x.path for x in full_text_list])\n
i += 1\n
i += 1\n
return \'SphinxSE index will be updated in background.\'\n
return \'SphinxSE index will be updated in background.\'\n
</string>
</value>
</string>
</value>
...
...
bt5/erp5_full_text_sphinxse_catalog/bt/template_catalog_method_id_list
View file @
9fda5829
erp5_mysql_innodb/SQLCatalog_
catalogSphinxSE
erp5_mysql_innodb/SQLCatalog_
deferFullTextIndex
erp5_mysql_innodb/SQLCatalog_defer
SphinxSEIndexing
erp5_mysql_innodb/SQLCatalog_defer
FullTextIndexActivity
erp5_mysql_innodb/SQLCatalog_makeFullTextQuery
erp5_mysql_innodb/SQLCatalog_makeFullTextQuery
erp5_mysql_innodb/z0_drop_fulltext
erp5_mysql_innodb/z0_drop_fulltext
erp5_mysql_innodb/z0_drop_sphinxse_index
erp5_mysql_innodb/z0_drop_sphinxse_index
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment