From 441f24394a3f628cc40801b5e194ff5897753d24 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Fri, 27 Jan 2006 10:39:02 +0000
Subject: [PATCH] Added searchable text support

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5368 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Document.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py
index 2f7adf0196..190a620e2b 100755
--- a/product/ERP5/Document/Document.py
+++ b/product/ERP5/Document/Document.py
@@ -77,4 +77,18 @@ class Document(XMLObject, TextContent):
     __implements__ = ()
 
     # Patch
-    PUT = TextContent.PUT
\ No newline at end of file
+    PUT = TextContent.PUT
+
+    ### Content indexing methods
+    security.declareProtected(Permissions.View, 'getSearchableText')
+    def getSearchableText(self, md=None):
+        """\
+        Used by the catalog for basic full text indexing
+        We should try to do some kind of file conversion here
+        """
+        searchable_text = "%s %s %s %s" %  (self.getTitle(), self.getDescription(),
+                                            self.getId(), self.getTextContent())
+        return searchable_text
+
+    # Compatibility with CMF Catalog / CPS sites
+    SearchableText = getSearchableText
-- 
2.30.9