No idea...try to track it down yourself, pull requests welcome. -aj
Jochen Dekeyser wrote > No, that output is from a Plone 4.2.5 UnifiedInstaller + > Products.TextIndexNG3 + no extras add-ons! Not from my add-on. But as I > understand your response, it was not meant to be (= the answer to my > question :-)). But for me, it is not really a problem, I just wanted to > understand the logic behind, so I can do the "right" things in my add-on, > so it looks tight and clean, and does not break easy in the future :-) > > If this might be a problem for you (maybe performance issues on large > files), it is located in > Products/TextIndexNG3/adapters/plone_adapters.py:ATFileAdapter.addSearchableTextField: > this method probably: > * in line 32: adds SearchableText (including data of text-file) > * in line 42: adds file content (data of text-file) > Maybe in the past, SearchableText did not contain file content. Did > portal_transforms exist when this code was written (2009-04-22)? I see > zopyx.txng3.core also contains some machinery to do transforms... Maybe > both Plone and TextIndexNG3 do a separate transform of file content? > > Jochen > > > > On Fri, Aug 30, 2013 at 11:25 AM, ajung < > lists@ > > wrote: > >> No idea, take the debugger and check your adapter is doing to extract the >> content >> from your file. >> >> -aj >> >> >> Jochen Dekeyser wrote >> > If I add a file in Plone /plone1: >> > * filename: my-file.txt >> > * content: this is content >> > >> > Afterwards go to the ZMI -> plone1 -> portal_catalog -> tab Catalog -> >> > /plone1/my-file.txt -> SearchableText shows: >> > [u'my-filetxt', u'my-filetxt',* u'this', u'is', u'content', u'this', >> > u'is', >> > u'content*'] >> > (the double u'my-filetxt' is from the ID and Title field and are >> normal) >> > >> > Jochen >> > >> > >> > On Fri, Aug 30, 2013 at 10:35 AM, ajung < >> >> > lists@ >> >> > > wrote: >> > >> >> What do yo mean with "the content of that text-file is added twice"? >> >> >> >> -aj >> >> >> >> >> >> Jochen Dekeyser wrote >> >> > Hi, >> >> > >> >> > I am trying to integrate Products.TextIndexNG3 in my Plone site. It >> >> works >> >> > very well. And I am customizing some stuff in an add-on for my >> sites. >> >> > >> >> > But I noticed a strange thing which I can not explain. If you add >> e.g. >> >> a >> >> > text-file (ATBlob) to the plone site, the content of that text-file >> is >> >> > added twice to the SearchableText-index... Although that works, I >> don't >> >> > find a good explanation... (Tested on Plone 4.2.5 Unified Installer >> + >> >> > Products.TextIndexNG3 3.4.7.1). So my question is: is there a reason >> >> why >> >> > this is done? >> >> > >> >> > I can reconfigure this behaviour in my add-on (so that is NOT the >> >> > question): >> >> > configure.zcml: >> >> > >> >> > >> > > <include package="z3c.unconfigure" file="meta.zcml"/> >> >> > >> >> > >> > > <unconfigure> >> >> > >> >> > >> > > <adapter >> > >> >> > > >> factory="Products.TextIndexNG3.adapters.plone_adapters.ATFileAdapter"/> >> >> > >> >> > >> > > </unconfigure> >> >> > >> >> > >> > > <adapter factory=".plone_adapters.ATFileAdapter"/> >> >> > plone_adapters.py: >> >> > from Products.ATContentTypes.interface.file import IATFile >> >> > from Products.TextIndexNG3.adapters.cmf_adapters import >> >> > CMFContentAdapter >> >> > from zope.component import adapts >> >> > from zope.interface import implements >> >> > from zopyx.txng3.core.interfaces import IIndexableContent >> >> > class ATFileAdapter(CMFContentAdapter): >> >> > adapts(IATFile) >> >> > implements(IIndexableContent) >> >> > >> >> > Jochen >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://plone.293351.n2.nabble.com/Products-TextIndexNG3-and-duplicate-content-in-SearchableText-index-for-ATBlob-tp7567516p7567517.html >> >> Sent from the Product Developers mailing list archive at Nabble.com. >> >> _______________________________________________ >> >> Product-Developers mailing list >> >> >> >> > Product-Developers@.plone >> >> >> https://lists.plone.org/mailman/listinfo/plone-product-developers >> >> >> > >> > _______________________________________________ >> > Product-Developers mailing list >> >> > Product-Developers@.plone >> >> > https://lists.plone.org/mailman/listinfo/plone-product-developers >> >> >> >> >> >> -- >> View this message in context: >> http://plone.293351.n2.nabble.com/Products-TextIndexNG3-and-duplicate-content-in-SearchableText-index-for-ATBlob-tp7567516p7567519.html >> Sent from the Product Developers mailing list archive at Nabble.com. >> _______________________________________________ >> Product-Developers mailing list >> > Product-Developers@.plone >> https://lists.plone.org/mailman/listinfo/plone-product-developers >> > > _______________________________________________ > Product-Developers mailing list > Product-Developers@.plone > https://lists.plone.org/mailman/listinfo/plone-product-developers -- View this message in context: http://plone.293351.n2.nabble.com/Products-TextIndexNG3-and-duplicate-content-in-SearchableText-index-for-ATBlob-tp7567516p7567523.html Sent from the Product Developers mailing list archive at Nabble.com. _______________________________________________ Product-Developers mailing list product-develop...@lists.plone.org https://lists.plone.org/mailman/listinfo/plone-product-developers