You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Guido Casper <gc...@s-und-n.de> on 2004/07/19 16:19:17 UTC

PROPPATCH causes ContentIndexer.dropIndex() to execute

Hi all,

I noticed that "TextContentIndexer.dropIndex()" does not actually drop 
anything from the index. The reason is that 
-TextContentIndexer.createIndex()
-TextContentIndexer.updateIndex()
add the URI as an unindexed field:
doc.add(Field.UnIndexed(URI_FIELD, uri.toString()));

so when you DELETE a document and TextContentIndexer.dropIndex() tries 
to drop the URI from the index via:
Term term = new Term(URI_FIELD, uri.toString());
indexReader.delete(term);

it fails (and your next DASL search hitting the previously existent 
resource's content fails as well).

I changed
doc.add(Field.UnIndexed(URI_FIELD, uri.toString()));
to
doc.add(Field.Keyword(URI_FIELD, uri.toString()));

so it works.

Now however I noticed that PROPPATCH mistakenly calls
ContentIndexer.dropIndex() (previously going unnoticed).

Does anyone have an idea what the cause might be?

Thanks
Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Re: PROPPATCH causes ContentIndexer.dropIndex() to execute

Posted by Guido Casper <gc...@s-und-n.de>.
OK, since VersioningHelper.checkin() calls:
content.remove( sToken, rUri, NodeRevisionNumber.HIDDEN_0_0 );

I've put:
if (number == NodeRevisionNumber.HIDDEN_0_0) return;

at the beginning of TextContentIndexer.dropIndex()

I'll submit a patch in bugzilla.

Guido


Guido Casper wrote:
> Hi all,
> 
> I noticed that "TextContentIndexer.dropIndex()" does not actually drop 
> anything from the index. The reason is that 
> -TextContentIndexer.createIndex()
> -TextContentIndexer.updateIndex()
> add the URI as an unindexed field:
> doc.add(Field.UnIndexed(URI_FIELD, uri.toString()));
> 
> so when you DELETE a document and TextContentIndexer.dropIndex() tries 
> to drop the URI from the index via:
> Term term = new Term(URI_FIELD, uri.toString());
> indexReader.delete(term);
> 
> it fails (and your next DASL search hitting the previously existent 
> resource's content fails as well).
> 
> I changed
> doc.add(Field.UnIndexed(URI_FIELD, uri.toString()));
> to
> doc.add(Field.Keyword(URI_FIELD, uri.toString()));
> 
> so it works.
> 
> Now however I noticed that PROPPATCH mistakenly calls
> ContentIndexer.dropIndex() (previously going unnoticed).
> 
> Does anyone have an idea what the cause might be?
> 
> Thanks
> Guido
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org