OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Lucene indexation : content items not indexed if created before index is created

Open Skrypt opened this issue 6 years ago • 4 comments

When we create a Lucene index after having creating some content items it won't index them because they did not get added to the IndexingTask table which gets added to the database only if you enable the Lucene module. So to repro.

Create some content items. Enable the Lucene feature. Create a Lucene Index. Hit rebuild index.

The content items won't be indexed. So we should add a new button on the Index List to resync the content items that should be added to the IndexingTask table. This button could also flush the ContentItems that should not be there at the same time.

Skrypt avatar Feb 05 '20 17:02 Skrypt

It should be a setting page in the indexing module, not per index or in lucene. The action could be as simple as iterate over all content items and create an index task record for it, then remove the previous taks records. All in batches.

sebastienros avatar Feb 05 '20 23:02 sebastienros

Hello, v.1.0.0-rc2-14196 I'm having exactly this issue. Some way to fix it? Thanks

MaxGasta avatar Aug 27 '20 11:08 MaxGasta

TODO : Test this query

INSERT INTO IndexingTask VALUES (
(SELECT ContentItemId, CreatedUtc, 0 FROM ContentItemIndex WHERE ContentItemId NOT IN (SELECT ContentItemId FROM IndexingTask) AND (ContentItemIndex.Published = 1 OR ContentItemIndex.Latest = 1))
)

Skrypt avatar Mar 09 '21 16:03 Skrypt

Hi, I see that this issue still open, and I faced with similar situation. I created PR (#16371) that will fix this issue.

AndreySurkov avatar Jun 25 '24 21:06 AndreySurkov