manudea
manudea

Reputation: 371

Orchard index with lucene is delayed

I have an index named Default in Orchard, alll is porperly configured o index some common parts and a part I have coded.

When I rebuild the index it always shows 0 documents indexed.

Non matter what I do I can hit update 100 times the index shows always 0 documents.

After some time (I cannot say exactly... after an hour or so) if I go to the index it is rebuilt with my 12567 documents.

Probably it is something by design but I do not get it...

My guess is that since the rebuilt of the index may be expensive in term or time and resources is scheduled at low priority and I have just wait the process.

Is there a way to force an immediate and complete rebuild?

The reason is that if I found a bug in my handler OnIndexing I have to wait an hour to see the effect of my fix...

Any idea?

Upvotes: 0

Views: 235

Answers (1)

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

Yes, indexing is a relatively heavy operation that is executed on a background thread. The class doing this is IndexingBackgroundTask, found in Orchard.Indexing.Services. The frequency at which background tasks are executed was, I think, recently raised in order to deal with scalability issues when there are hundreds of tenants on a single Orchard instance. This is configured in Config/Sites.config. Look for this bit of XML:

<component instance-scope="single-instance"
           type="Orchard.Tasks.SweepGenerator"
           service="Orchard.Tasks.ISweepGenerator">
    <properties>
        <property name="Interval" value="00:01:00" />
    </properties>
</component>

You can change the interval value to something smaller, if you understand the implications in the case where you have lots of tenants.

Upvotes: 1

Related Questions