diff --git a/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml index 7016a85a28f2aeb5090184aa6c5cfa26d10dae72..debd7365b95472b99579e46b680c1b53a76615d5 100644 --- a/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_accounting/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -1,10 +1,10 @@ <key_list> <key>accounting_transaction_line_node_uid | stock/node_uid/z_related_accounting_transaction_stock_line</key> <key>accounting_transaction_line_total_price | stock/total_price/z_related_accounting_transaction_stock_line</key> - <key>accounting_transaction_mirror_section_title | catalog_full_text/title/z_related_accounting_transaction_mirror_section</key> - <key>accounting_transaction_payment_title | catalog_full_text/title/z_related_accounting_transaction_payment</key> - <key>accounting_transaction_project_title | catalog_full_text/title/z_related_accounting_transaction_project</key> - <key>accounting_transaction_section_title | catalog_full_text/title/z_related_accounting_transaction_section</key> + <key>accounting_transaction_mirror_section_title | catalog/title/z_related_accounting_transaction_mirror_section</key> + <key>accounting_transaction_payment_title | catalog/title/z_related_accounting_transaction_payment</key> + <key>accounting_transaction_project_title | catalog/title/z_related_accounting_transaction_project</key> + <key>accounting_transaction_section_title | catalog/title/z_related_accounting_transaction_section</key> <key>preferred_gap_id | category,catalog/id/z_related_preferred_gap</key> <key>preferred_gap_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_accounting/bt/template_catalog_related_key_list b/bt5/erp5_accounting/bt/template_catalog_related_key_list index 1f5a0ffbcf8afd2715897de2ea571f252ea091b3..dcde7ac950dca0e9a03cd7ed15226f3c43c9d95f 100644 --- a/bt5/erp5_accounting/bt/template_catalog_related_key_list +++ b/bt5/erp5_accounting/bt/template_catalog_related_key_list @@ -1,8 +1,8 @@ preferred_gap_id | category,catalog/id/z_related_preferred_gap preferred_gap_strict_membership_id | category,catalog/id/z_related_strict_membership_preferred_gap -accounting_transaction_mirror_section_title | catalog_full_text/title/z_related_accounting_transaction_mirror_section -accounting_transaction_section_title | catalog_full_text/title/z_related_accounting_transaction_section -accounting_transaction_project_title | catalog_full_text/title/z_related_accounting_transaction_project -accounting_transaction_payment_title | catalog_full_text/title/z_related_accounting_transaction_payment +accounting_transaction_mirror_section_title | catalog/title/z_related_accounting_transaction_mirror_section +accounting_transaction_section_title | catalog/title/z_related_accounting_transaction_section +accounting_transaction_project_title | catalog/title/z_related_accounting_transaction_project +accounting_transaction_payment_title | catalog/title/z_related_accounting_transaction_payment accounting_transaction_line_node_uid | stock/node_uid/z_related_accounting_transaction_stock_line accounting_transaction_line_total_price | stock/total_price/z_related_accounting_transaction_stock_line \ No newline at end of file diff --git a/bt5/erp5_base/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_base/CatalogRelatedKeyTemplateItem/related_key_list.xml index 573710d183a789b8c2f2fba86d608cad9298cbae..59d2ac3edeb7257c725c20cc8d79c8f410ade4b5 100644 --- a/bt5/erp5_base/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_base/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -2,8 +2,8 @@ <key>child_address_SearchableText | catalog,full_text/SearchableText/z_related_child_address</key> <key>child_telephone_SearchableText | catalog,full_text/SearchableText/z_related_child_telephone</key> <key>default_email_text | catalog,email/url_string/z_related_default_email</key> - <key>destination_person_title | category,catalog,catalog_full_text/title/z_related_destination_person_full_text</key> + <key>destination_person_title | category,catalog/title/z_related_destination_person</key> <key>related_resource_use_uid | category,category,catalog,catalog/uid/z_related_resource_use</key> - <key>source_organisation_title | category,catalog,catalog_full_text/title/z_related_source_organisation_full_text</key> - <key>source_person_title | category,catalog,catalog_full_text/title/z_related_source_person_full_text</key> + <key>source_organisation_title | category,catalog/title/z_related_source_organisation</key> + <key>source_person_title | category,catalog/title/z_related_source_person</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_base/bt/template_catalog_related_key_list b/bt5/erp5_base/bt/template_catalog_related_key_list index 54c0c6b82eba5eabf42c88dbf622bfdaa6012b7c..95319495c6e385321f115f05b469d6d1cc71ae49 100644 --- a/bt5/erp5_base/bt/template_catalog_related_key_list +++ b/bt5/erp5_base/bt/template_catalog_related_key_list @@ -1,6 +1,6 @@ -source_organisation_title | category,catalog,catalog_full_text/title/z_related_source_organisation_full_text -source_person_title | category,catalog,catalog_full_text/title/z_related_source_person_full_text -destination_person_title | category,catalog,catalog_full_text/title/z_related_destination_person_full_text +source_organisation_title | category,catalog/title/z_related_source_organisation +source_person_title | category,catalog/title/z_related_source_person +destination_person_title | category,catalog/title/z_related_destination_person default_email_text | catalog,email/url_string/z_related_default_email related_resource_use_uid | category,category,catalog,catalog/uid/z_related_resource_use child_address_SearchableText | catalog,full_text/SearchableText/z_related_child_address diff --git a/bt5/erp5_full_text_mroonga_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_full_text_mroonga_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml index 2ced6f2d7221c57fc21448d899f9aad65f320c81..4c178fc3d867040dbf15515b7a879821cff1c598 100644 --- a/bt5/erp5_full_text_mroonga_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_full_text_mroonga_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -1,10 +1,8 @@ <key_list> - <key>career_skill_title | category,catalog,catalog_full_text/title/z_related_career_skill</key> - <key>description | catalog_full_text/description/z_related_uid</key> - <key>parent_description | catalog_full_text/description/z_related_parent</key> - <key>parent_title | catalog_full_text/title/z_related_parent</key> - <key>stock_explanation_title | catalog_full_text/title/z_related_explanation_from_stock</key> - <key>stock_mirror_section_title | catalog_full_text/title/z_related_mirror_section_uid_from_stock</key> - <key>stock_node_title | catalog_full_text/title/z_related_node_uid_from_stock</key> - <key>title | catalog_full_text/title/z_related_uid</key> + <key>career_skill_title | category,catalog,catalog/title/z_related_career_skill</key> + <key>parent_description | catalog/description/z_related_parent</key> + <key>parent_title | catalog/title/z_related_parent</key> + <key>stock_explanation_title | catalog/title/z_related_explanation_from_stock</key> + <key>stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock</key> + <key>stock_node_title | catalog/title/z_related_node_uid_from_stock</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_full_text_mroonga_catalog/CatalogSearchKeyTemplateItem/search_key_list.xml b/bt5/erp5_full_text_mroonga_catalog/CatalogSearchKeyTemplateItem/search_key_list.xml index caead947b56fc4a3050bd02e7f72a8fc61be99db..998029c34c10f4c70ec1a428733c0e369382ad56 100644 --- a/bt5/erp5_full_text_mroonga_catalog/CatalogSearchKeyTemplateItem/search_key_list.xml +++ b/bt5/erp5_full_text_mroonga_catalog/CatalogSearchKeyTemplateItem/search_key_list.xml @@ -2,7 +2,5 @@ <key>SearchableText | MroongaBooleanFullTextKey</key> <key>catalog_full_text.description | MroongaBooleanFullTextKey</key> <key>catalog_full_text.title | MroongaBooleanFullTextKey</key> - <key>description | MroongaBooleanFullTextKey</key> <key>full_text.SearchableText | MroongaBooleanFullTextKey</key> - <key>title | MroongaBooleanFullTextKey</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_related_key_list b/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_related_key_list index 693452ae6b429b34ecd0db8797872c54cc6f6087..d1343c2552745dd2b4c6dff980b509de185a7b86 100644 --- a/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_related_key_list +++ b/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_related_key_list @@ -1,8 +1,6 @@ -career_skill_title | category,catalog,catalog_full_text/title/z_related_career_skill -description | catalog_full_text/description/z_related_uid -parent_description | catalog_full_text/description/z_related_parent -parent_title | catalog_full_text/title/z_related_parent -stock_explanation_title | catalog_full_text/title/z_related_explanation_from_stock -stock_mirror_section_title | catalog_full_text/title/z_related_mirror_section_uid_from_stock -stock_node_title | catalog_full_text/title/z_related_node_uid_from_stock -title | catalog_full_text/title/z_related_uid \ No newline at end of file +career_skill_title | category,catalog,catalog/title/z_related_career_skill +parent_description | catalog/description/z_related_parent +parent_title | catalog/title/z_related_parent +stock_explanation_title | catalog/title/z_related_explanation_from_stock +stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock +stock_node_title | catalog/title/z_related_node_uid_from_stock \ No newline at end of file diff --git a/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_search_key_list b/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_search_key_list index 3c63ebce67946f10becd09e01c37b8f4e1ef5464..38f8c2b386871f5107a04ee6a4ed26db86acf803 100644 --- a/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_search_key_list +++ b/bt5/erp5_full_text_mroonga_catalog/bt/template_catalog_search_key_list @@ -1,6 +1,4 @@ SearchableText | MroongaBooleanFullTextKey catalog_full_text.description | MroongaBooleanFullTextKey catalog_full_text.title | MroongaBooleanFullTextKey -description | MroongaBooleanFullTextKey -full_text.SearchableText | MroongaBooleanFullTextKey -title | MroongaBooleanFullTextKey \ No newline at end of file +full_text.SearchableText | MroongaBooleanFullTextKey \ No newline at end of file diff --git a/bt5/erp5_full_text_myisam_catalog/CatalogFullTextKeyTemplateItem/full_text_key_list.xml b/bt5/erp5_full_text_myisam_catalog/CatalogFullTextKeyTemplateItem/full_text_key_list.xml index 6bee43e19e731642a040f3c25bc845070611f04b..3a4fdd30d7b4198bbdfcfc67ef1a57c8db9c871a 100644 --- a/bt5/erp5_full_text_myisam_catalog/CatalogFullTextKeyTemplateItem/full_text_key_list.xml +++ b/bt5/erp5_full_text_myisam_catalog/CatalogFullTextKeyTemplateItem/full_text_key_list.xml @@ -2,7 +2,5 @@ <key>SearchableText</key> <key>catalog_full_text.description</key> <key>catalog_full_text.title</key> | - <key>description</key> | <key>full_text.SearchableText</key> | - <key>title</key> | </key_list> \ No newline at end of file diff --git a/bt5/erp5_full_text_myisam_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_full_text_myisam_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml index 2ced6f2d7221c57fc21448d899f9aad65f320c81..534774f2b6bf206e53d1bd3905f3f065e3fd86bb 100644 --- a/bt5/erp5_full_text_myisam_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_full_text_myisam_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -1,10 +1,8 @@ <key_list> - <key>career_skill_title | category,catalog,catalog_full_text/title/z_related_career_skill</key> - <key>description | catalog_full_text/description/z_related_uid</key> - <key>parent_description | catalog_full_text/description/z_related_parent</key> - <key>parent_title | catalog_full_text/title/z_related_parent</key> - <key>stock_explanation_title | catalog_full_text/title/z_related_explanation_from_stock</key> - <key>stock_mirror_section_title | catalog_full_text/title/z_related_mirror_section_uid_from_stock</key> - <key>stock_node_title | catalog_full_text/title/z_related_node_uid_from_stock</key> - <key>title | catalog_full_text/title/z_related_uid</key> -</key_list> \ No newline at end of file + <key>career_skill_title | category,catalog,catalog/title/z_related_career_skill</key> + <key>parent_description | catalog/description/z_related_parent</key> + <key>parent_title | catalog/title/z_related_parent</key> + <key>stock_explanation_title | catalog/title/z_related_explanation_from_stock</key> + <key>stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock</key> + <key>stock_node_title | catalog/title/z_related_node_uid_from_stock</key> +</key_list> diff --git a/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_full_text_key_list b/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_full_text_key_list index 163cb04a95cb1476ae59bc9bf8dbdf6ee4b15007..b9eaf0acb2f57bad8d18c1b229089c7d2a0b9b87 100644 --- a/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_full_text_key_list +++ b/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_full_text_key_list @@ -1,6 +1,4 @@ SearchableText catalog_full_text.description catalog_full_text.title -description -full_text.SearchableText -title \ No newline at end of file +full_text.SearchableText \ No newline at end of file diff --git a/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_related_key_list b/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_related_key_list index 693452ae6b429b34ecd0db8797872c54cc6f6087..d1343c2552745dd2b4c6dff980b509de185a7b86 100644 --- a/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_related_key_list +++ b/bt5/erp5_full_text_myisam_catalog/bt/template_catalog_related_key_list @@ -1,8 +1,6 @@ -career_skill_title | category,catalog,catalog_full_text/title/z_related_career_skill -description | catalog_full_text/description/z_related_uid -parent_description | catalog_full_text/description/z_related_parent -parent_title | catalog_full_text/title/z_related_parent -stock_explanation_title | catalog_full_text/title/z_related_explanation_from_stock -stock_mirror_section_title | catalog_full_text/title/z_related_mirror_section_uid_from_stock -stock_node_title | catalog_full_text/title/z_related_node_uid_from_stock -title | catalog_full_text/title/z_related_uid \ No newline at end of file +career_skill_title | category,catalog,catalog/title/z_related_career_skill +parent_description | catalog/description/z_related_parent +parent_title | catalog/title/z_related_parent +stock_explanation_title | catalog/title/z_related_explanation_from_stock +stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock +stock_node_title | catalog/title/z_related_node_uid_from_stock \ No newline at end of file diff --git a/bt5/erp5_item/CatalogRelatedKeyTemplateItem/related_key_list.xml b/bt5/erp5_item/CatalogRelatedKeyTemplateItem/related_key_list.xml index 4c324fb3d7fb6563787646df9f2e1cfd01596e18..e34497d8c0d1498eb21a39037605906615cd4fdb 100644 --- a/bt5/erp5_item/CatalogRelatedKeyTemplateItem/related_key_list.xml +++ b/bt5/erp5_item/CatalogRelatedKeyTemplateItem/related_key_list.xml @@ -1,6 +1,6 @@ <key_list> <key>item_catalog_portal_type | catalog/portal_type/z_related_item_catalog</key> <key>item_catalog_reference | catalog/reference/z_related_item_catalog</key> - <key>item_catalog_title | catalog_full_text/title/z_related_item_catalog</key> + <key>item_catalog_title | catalog/title/z_related_item_catalog</key> <key>item_catalog_validation_state | catalog/validation_state/z_related_item_catalog</key> </key_list> \ No newline at end of file diff --git a/bt5/erp5_item/bt/template_catalog_related_key_list b/bt5/erp5_item/bt/template_catalog_related_key_list index 005743929603f61afbd1eac399f0256ffa17458a..eecc7c1038291bdeed4a5b6de105bc137c347e85 100644 --- a/bt5/erp5_item/bt/template_catalog_related_key_list +++ b/bt5/erp5_item/bt/template_catalog_related_key_list @@ -1,4 +1,4 @@ -item_catalog_title | catalog_full_text/title/z_related_item_catalog +item_catalog_title | catalog/title/z_related_item_catalog item_catalog_portal_type | catalog/portal_type/z_related_item_catalog item_catalog_reference | catalog/reference/z_related_item_catalog item_catalog_validation_state | catalog/validation_state/z_related_item_catalog \ No newline at end of file diff --git a/product/ERP5/tests/testI18NSearch.py b/product/ERP5/tests/testI18NSearch.py index 6c4e0ba6bc4e1ca672c508e58949b39b0e8034be..eed405f588e5c70f58f3d53214f0e66d7b1981dd 100644 --- a/product/ERP5/tests/testI18NSearch.py +++ b/product/ERP5/tests/testI18NSearch.py @@ -27,6 +27,7 @@ ############################################################################## import unittest +from unittest import expectedFailure from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase class TestI18NSearch(ERP5TypeTestCase): @@ -37,56 +38,111 @@ class TestI18NSearch(ERP5TypeTestCase): return ('erp5_full_text_mroonga_catalog', 'erp5_base',) - def test_full_test_search(self): - person_module = self.portal.person_module - person1 = person_module.newContent( + def afterSetUp(self): + self.person_module = self.portal.person_module + self.person1 = self.person_module.newContent( portal_type='Person', first_name='Gabriel', last_name='Fauré', description='Quick brown fox jumps over the lazy dog.', ) - person2 = person_module.newContent( + self.person2 = self.person_module.newContent( portal_type='Person', first_name='æ¦è€…å°è·¯', last_name='実篤', description='Slow white fox jumps over the diligent dog.', ) - person3 = person_module.newContent( + self.person3 = self.person_module.newContent( portal_type='Person', first_name='( - + )', last_name='', ) self.tic() + def beforeTearDown(self): + self.person_module.manage_delObjects(ids=list(tuple(self.person_module.objectIds()))) + self.tic() + + def test_full_text_searchable_text(self): # check if 'é' == 'e' collation works - result = person_module.searchFolder(SearchableText='Faure') + result = self.person_module.searchFolder(SearchableText='Faure') self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person1.getPath()) - result = person_module.searchFolder(title='Faure') - self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person1.getPath()) + self.assertEqual(result[0].getPath(), self.person1.getPath()) # check if a partial string of CJK string matches - result = person_module.searchFolder(SearchableText='æ¦è€…') + result = self.person_module.searchFolder(SearchableText='æ¦è€…') + self.assertEqual(len(result), 1) + self.assertEqual(result[0].getPath(), self.person2.getPath()) + + # check boolean language mode search + result = self.person_module.searchFolder(SearchableText='+quick +fox +dog') + self.assertEqual(len(result), 1) + self.assertEqual(result[0].getPath(), self.person1.getPath()) + + # check sort on fulltext column + self.assertFalse('ORDER BY\n MATCH' in self.portal.portal_catalog(SearchableText='Faure', sort_on=(('SearchableText', 'ascending'),), src__=1)) + + # check sort on fulltext search score + self.assertTrue('ORDER BY\n MATCH' in self.portal.portal_catalog(SearchableText='Faure', sort_on=(('SearchableText__score__', 'ascending'),), src__=1)) + + def test_catalog_full_text_title(self): + # check if 'é' == 'e' collation works + result = self.person_module.searchFolder(**{'catalog_full_text.title':'Faure'}) self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person2.getPath()) - result = person_module.searchFolder(title='æ¦è€…') + self.assertEqual(result[0].getPath(), self.person1.getPath()) + + # check if a partial string of CJK string matches + result = self.person_module.searchFolder(**{'catalog_full_text.title':'æ¦è€…'}) self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person2.getPath()) + self.assertEqual(result[0].getPath(), self.person2.getPath()) # check boolean language mode search - result = person_module.searchFolder(SearchableText='+quick +fox +dog') + result = self.person_module.searchFolder(**{'catalog_full_text.description':'+quick +fox +dog'}) self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person1.getPath()) - result = person_module.searchFolder(description='+quick +fox +dog') + self.assertEqual(result[0].getPath(), self.person1.getPath()) + + # check search with a special character + for query in ('(', ')', ): + result = self.person_module.searchFolder(**{'catalog_full_text.title':query}) + self.assertEqual(len(result), 1) + self.assertEqual(result[0].getPath(), self.person3.getPath()) + + # check sort on fulltext column + self.assertFalse('ORDER BY\n MATCH' in self.portal.portal_catalog(**{ + 'catalog_full_text.title':'Faure', + 'sort_on':(('catalog_full_text.title', 'ascending'),), + 'src__':1 + })) + + # check sort on fulltext search score + self.assertFalse('ORDER BY\n MATCH' in self.portal.portal_catalog(**{ + 'catalog_full_text.title':'Faure', + 'sort_on':(('catalog_full_text.title__score__', 'ascending'),), + 'src__':1 + })) + + @expectedFailure + def test_full_text_title(self): + # check if 'é' == 'e' collation works + result = self.person_module.searchFolder(title='Faure') + self.assertEqual(len(result), 1) + self.assertEqual(result[0].getPath(), self.person1.getPath()) + + # check if a partial string of CJK string matches + result = self.person_module.searchFolder(title='æ¦è€…') + self.assertEqual(len(result), 1) + self.assertEqual(result[0].getPath(), self.person2.getPath()) + + # check boolean language mode search + result = self.person_module.searchFolder(description='+quick +fox +dog') self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person1.getPath()) + self.assertEqual(result[0].getPath(), self.person1.getPath()) # check search with a special character for query in ('(', ')', ): - result = person_module.searchFolder(title=query) + result = self.person_module.searchFolder(title=query) self.assertEqual(len(result), 1) - self.assertEqual(result[0].getPath(), person3.getPath()) + self.assertEqual(result[0].getPath(), self.person3.getPath()) # check fulltext search for automatically generated related keys. self.assertTrue('MATCH' in self.portal.portal_catalog(destination_title='Faure', src__=1)) diff --git a/product/ERP5Catalog/CatalogTool.py b/product/ERP5Catalog/CatalogTool.py index bbc75ad133ef7c4d3bd1f171af9f2bba00889038..95b031349f0e83aca76b1f8e0c543b0f1788b7a8 100644 --- a/product/ERP5Catalog/CatalogTool.py +++ b/product/ERP5Catalog/CatalogTool.py @@ -881,10 +881,9 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): by looking at the category tree. For exemple it will generate: - destination_reference | category,catalog/reference/z_related_destination - default_destination_reference | category,catalog/reference/z_related_destination - strict_destination_reference | category,catalog/reference/z_related_strict_destination - destination_title | category,catalog_full_text/title/z_related_destination + destination_title | category,catalog/title/z_related_destination + default_destination_title | category,catalog/title/z_related_destination + strict_destination_title | category,catalog/title/z_related_strict_destination strict_ related keys only returns documents which are strictly member of the category. @@ -918,18 +917,9 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): if related: end_key = end_key[len(related_string):] # XXX: joining with non-catalog tables is not trivial and requires - # ZSQLCatalog's ColumnMapper cooperation, so only allow columns in - # catalog or catalog_full_text tables. - if end_key != 'uid' and 'catalog_full_text' in column_map.get(end_key, ()): - related_key_list.append( - prefix + key + ' | category,catalog_full_text/' + - end_key + - '/z_related_' + - ('strict_' if strict else '') + - expected_base_cat_id + - ('_related' if related else '') - ) - elif 'catalog' in column_map.get(end_key, ()): + # ZSQLCatalog's ColumnMapper cooperation, so only allow catalog + # columns. + if 'catalog' in column_map.get(end_key, ()): is_uid = end_key == 'uid' if is_uid: end_key = 'uid' if related else 'category_uid' diff --git a/product/ERP5OOo/tests/testDms.py b/product/ERP5OOo/tests/testDms.py index 7d34cda0cde65c65b41158f852963dea7da7550b..ae7c16d3ba2a3742a0f4d2d45862188f78475d92 100644 --- a/product/ERP5OOo/tests/testDms.py +++ b/product/ERP5OOo/tests/testDms.py @@ -1243,7 +1243,7 @@ class TestDocument(TestDocumentMixin): # should return all documents matching a word no matter of contributor self.assertSameSet([web_page_1, document_4], getAdvancedSearchStringResultList(**kw)) kw = {'searchabletext_any': 'owner', - 'contributor_title': 'Contributor'} + 'contributor_title': '%Contributor%'} self.assertSameSet([document_4], getAdvancedSearchStringResultList(**kw)) # multiple portal_type specified