与lucene的果园指数延迟

时间:2020-12-02 03:06:34

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

我在Orchard中有一个名为Default的索引,alll正在配置索引一些常用部分和我编码的部分。

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

当我重建索引时,它总是显示索引的0个文档。

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

无论我做什么我都可以点击更新100次索引显示总是0文件。

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.

过了一段时间(我不能确切地说......一小时左右之后)如果我去索引它会用我的12567文件重建。

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...

原因是,如果我在我的处理程序OnIndexing中发现了一个错误,我必须等待一个小时才能看到我修复的效果......

Any idea?

任何想法?

1 个解决方案

#1


1  

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:

是的,索引是一个在后台线程上执行的相对繁重的操作。这样做的类是IndexingBackgroundTask,可以在Orchard.Indexing.Services中找到。我认为,最近提出了后台任务执行的频率,以便在单个Orchard实例上有数百个租户时处理可伸缩性问题。这在Config / Sites.config中配置。寻找这一点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.

如果您了解在拥有大量租户的情况下的含义,则可以将间隔值更改为更小的值。

#1


1  

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:

是的,索引是一个在后台线程上执行的相对繁重的操作。这样做的类是IndexingBackgroundTask,可以在Orchard.Indexing.Services中找到。我认为,最近提出了后台任务执行的频率,以便在单个Orchard实例上有数百个租户时处理可伸缩性问题。这在Config / Sites.config中配置。寻找这一点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.

如果您了解在拥有大量租户的情况下的含义,则可以将间隔值更改为更小的值。