Commit 77595f91 authored by Ivan Tyagov's avatar Ivan Tyagov

Add site configurable 'full_text' scriptable key.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42730 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 10d2b477
<?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
Generic full text searchable key which based on site configuration will use\n
available third party search engine (Sphinx) or fall back to default \n
MySQL full text search.\n
"""\n
from Products.ZSQLCatalog.SQLCatalog import Query\n
\n
if context.SQLCatalog_isSphinxSearchAvailable():\n
query = Query(**{\'sphinxse_query\':value})\n
else:\n
query = Query(**{\'full_text.SearchableText\':value})\n
return query\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>value</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SQLCatalog_makeFullTextQuery</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<key_list> <key_list>
<key>advanced_search_text | SQLCatalog_makeQuickSearchQuery</key> <key>advanced_search_text | SQLCatalog_makeQuickSearchQuery</key>
<key>full_text | SQLCatalog_makeFullTextQuery</key>
<key>quick_search_text | SQLCatalog_makeQuickSearchQuery</key> <key>quick_search_text | SQLCatalog_makeQuickSearchQuery</key>
</key_list> </key_list>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OrderedFolder" module="OFS.OrderedFolder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_mysql_innodb_catalog</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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
Used to check if Sphinx search is available.\n
Proxy mode added so this check can happen for anonymous users.\n
"""\n
# XXX Should we use system preference here?\n
portal_catalog = context.getPortalObject().portal_catalog\n
return \'sphinxse_index\' in getattr(portal_catalog, portal_catalog.default_sql_catalog_id).getCatalogSearchTableIds()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SQLCatalog_isSphinxSearchAvailable</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2011-01-28 Ivan
* Add site configurable 'full_text' scriptable key
2010-11-08 Kazuhiko 2010-11-08 Kazuhiko
* support cataloging multiple subjects. * support cataloging multiple subjects.
* subject related tables are moved from erp5_ingestion_mysql_innodb_catalog. * subject related tables are moved from erp5_ingestion_mysql_innodb_catalog.
......
211 213
\ No newline at end of file \ No newline at end of file
erp5_mysql_innodb/SQLCatalog_catalogTransformation erp5_mysql_innodb/SQLCatalog_catalogTransformation
erp5_mysql_innodb/SQLCatalog_catalogTransformationList erp5_mysql_innodb/SQLCatalog_catalogTransformationList
erp5_mysql_innodb/SQLCatalog_makeFullTextQuery
erp5_mysql_innodb/SQLCatalog_makeQuickSearchQuery erp5_mysql_innodb/SQLCatalog_makeQuickSearchQuery
erp5_mysql_innodb/z0_drop_alarm erp5_mysql_innodb/z0_drop_alarm
erp5_mysql_innodb/z0_drop_catalog erp5_mysql_innodb/z0_drop_catalog
......
quick_search_text | SQLCatalog_makeQuickSearchQuery quick_search_text | SQLCatalog_makeQuickSearchQuery
advanced_search_text | SQLCatalog_makeQuickSearchQuery advanced_search_text | SQLCatalog_makeQuickSearchQuery
\ No newline at end of file full_text | SQLCatalog_makeFullTextQuery
\ No newline at end of file
erp5_mysql_innodb_catalog
\ 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