<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Hanno,<br>
<br>
I did not know if checking the current index value could be faster
or slower than indexing anyway.<br>
<br>
I think that checking the current index length could do what we
need :<br>
<br>
Keeping the current code and changing this :<br>
<br>
<br>
<font face="Courier New, Courier, monospace">--- if all_texts:<br>
+++ if all_texts or self.index.length():<br>
return self.index.index_doc(documentId, all_texts)</font><br>
<br>
<br>
This way, it we have all_texts or if the index already contains
something, we reindex...<br>
<br>
Would this keep the optimization?<br>
<br>
I adapted here and every tests passed...<br>
<br>
<div class="moz-signature">
<table style="page-break-before: always; page-break-inside:
avoid" cellpadding="4" cellspacing="0">
<tbody>
<tr valign="TOP">
<td style="border: none; padding: 0cm" width="200">
<p><img src="cid:part1.01040809.01040701@imio.be"
name="images1" height="79" align="BOTTOM" border="0"
width="191"></p>
</td>
<td style="border: none; padding: 0cm">
<pre class="western">Gauthier Bastien
Support IMIO - CommunesPlone
rue de la Vieille Sambre 34
5190 Mornimont
Tél: +32(0)71 780979</pre>
</td>
</tr>
<tr>
<td colspan="2" style="font-size: 10px; color: grey;">
Disclaimer
<br>
<br>
Les informations contenues dans ce courrier électronique
(annexes incluses) sont confidentielles et réservées à
l'usage exclusif des destinataires repris ci-dessus. Si
vous n'êtes pas le destinataire, soyez informé par la
présente que vous ne pouvez ni divulguer, ni reproduire,
ni faire usage de ces informations pour vous-même ou
toute tierce personne. Si vous avez reçu ce courrier
électronique par erreur, vous êtes prié d'en avertir
immédiatement l'expéditeur et d'effacer le message
e-mail de votre ordinateur.
<br>
<br>
De informatie in deze e-mail, bijlagen inbegrepen, is
vertrouwelijk en is als dus danig voorbehouden voor
exclusief gebruik door de hierboven vermelde
bestemmeling(en). Indien u niet de bestemmeling bent,
willen wij u erop wijzen dat u deze informatie niet mag
aanwenden voor eigen gebruik noch verspreiden aan
derden. Indien u deze e-mail per ongeluk hebt ontvangen,
gelieve de afzender onmiddellijk te verwittigen en deze
e-mail van uw computer te verwijderen.
<br>
<br>
The information contained in this e-mail and the annexed
documents is confidential and exclusively available to
the here above mentioned addressee(s).Should you not be
the addressee, please be informed that you may neither
disclose nor reproduce this e-mail, nor may the
information contained in this e-mail and its eventually
annexed documents be used by yourself or by a third
party. If you erroneously received this e-mail, could
you kindly and immediately inform the addresser and
delete the message on your computer.
</td>
</tr>
</tbody>
</table>
</div>
Le 14/11/12 16:26, Hanno Schlichting a écrit :<br>
</div>
<blockquote
cite="mid:CAJ5sox65FOv3yNTFJhMJS-nJ-wZFX+RPsgXG1j0LVWxQ9dKJKg@mail.gmail.com"
type="cite">Hi.<br>
<br>
The change looks ok. But I think you broke an optimization. IIRC
the code compares the old and new values for the index, and skips
the indexing step if they are the same. The typical
item.reindexObject() call sents data for all indexes, even if just
one or two them have changed. The optimization made sure to skip
any extra work, if there wasn't really any change for the text
index. Without that check, you end up updating and writing a bunch
of internal data structures in the text index every time. Those
lead to slower write performance and more conflict errors.<br>
<br>
Could you have another look, and see if you can preserve the
optimization?<br>
<br>
Thanks,<br>
Hanno<br>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Nov 14, 2012 at 4:16 PM,
Gauthier Bastien <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:gauthier@imio.be"
target="_blank">gauthier@imio.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hi everybody,<br>
<br>
I made a small change in the current Products.ZCTextIndex
product, the change can be saw here :<br>
<br>
<a moz-do-not-send="true"
href="http://svn.zope.org/Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py?rev=128273&sortby=log&r2=128273&r1=113689"
target="_blank">http://svn.zope.org/Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py?rev=128273&sortby=log&r2=128273&r1=113689</a><br>
<br>
and I added a test here :<br>
<br>
<a moz-do-not-send="true"
href="http://svn.zope.org/Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/tests/testZCTextIndex.py?rev=128273&sortby=log&r2=128273&r1=113689"
target="_blank">http://svn.zope.org/Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/tests/testZCTextIndex.py?rev=128273&sortby=log&r2=128273&r1=113689</a><br>
<br>
This fixes ticket : <a moz-do-not-send="true"
href="https://dev.plone.org/ticket/13310"
target="_blank">https://dev.plone.org/ticket/13310</a> :
while reindexing, if the new content is empty, the index
is not reindexed and the last indexed value is kept.<br>
<br>
I just wonder if it was the way to go, and if it was and
if a reviewer can confirm that changes are OK, what to do
to release a new version because this is a huge bug for
us...<br>
<br>
Thank you and have a nice end of day,<br>
<br>
<div>-- <br>
<table cellpadding="4" cellspacing="0">
<tbody>
<tr valign="TOP">
<td style="border:none;padding:0cm" width="200">
<p><img
src="cid:part6.07080702.07040502@imio.be"
name="13aff7ea138d8373_images1" height="79"
align="BOTTOM" border="0" width="191"></p>
</td>
<td style="border:none;padding:0cm">
<pre>Gauthier Bastien
Support IMIO - CommunesPlone
rue de la Vieille Sambre 34
5190 Mornimont
Tél: <a moz-do-not-send="true" href="tel:%2B32%280%2971%20780979" value="+3271780979" target="_blank">+32(0)71 780979</a></pre>
</td>
</tr>
<tr>
<td colspan="2" style="font-size:10px;color:grey">
Disclaimer <br>
<br>
Les informations contenues dans ce courrier
électronique (annexes incluses) sont
confidentielles et réservées à l'usage exclusif
des destinataires repris ci-dessus. Si vous
n'êtes pas le destinataire, soyez informé par la
présente que vous ne pouvez ni divulguer, ni
reproduire, ni faire usage de ces informations
pour vous-même ou toute tierce personne. Si vous
avez reçu ce courrier électronique par erreur,
vous êtes prié d'en avertir immédiatement
l'expéditeur et d'effacer le message e-mail de
votre ordinateur. <br>
<br>
De informatie in deze e-mail, bijlagen
inbegrepen, is vertrouwelijk en is als dus danig
voorbehouden voor exclusief gebruik door de
hierboven vermelde bestemmeling(en). Indien u
niet de bestemmeling bent, willen wij u erop
wijzen dat u deze informatie niet mag aanwenden
voor eigen gebruik noch verspreiden aan derden.
Indien u deze e-mail per ongeluk hebt ontvangen,
gelieve de afzender onmiddellijk te verwittigen
en deze e-mail van uw computer te verwijderen. <br>
<br>
The information contained in this e-mail and the
annexed documents is confidential and
exclusively available to the here above
mentioned addressee(s).Should you not be the
addressee, please be informed that you may
neither disclose nor reproduce this e-mail, nor
may the information contained in this e-mail and
its eventually annexed documents be used by
yourself or by a third party. If you erroneously
received this e-mail, could you kindly and
immediately inform the addresser and delete the
message on your computer. </td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
_______________________________________________<br>
Zope-Dev maillist - <a moz-do-not-send="true"
href="mailto:Zope-Dev@zope.org">Zope-Dev@zope.org</a><br>
<a moz-do-not-send="true"
href="https://mail.zope.org/mailman/listinfo/zope-dev"
target="_blank">https://mail.zope.org/mailman/listinfo/zope-dev</a><br>
** No cross posts or HTML encoding! **<br>
(Related lists -<br>
<a moz-do-not-send="true"
href="https://mail.zope.org/mailman/listinfo/zope-announce"
target="_blank">https://mail.zope.org/mailman/listinfo/zope-announce</a><br>
<a moz-do-not-send="true"
href="https://mail.zope.org/mailman/listinfo/zope"
target="_blank">https://mail.zope.org/mailman/listinfo/zope</a>
)<br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>