English 中文(简体)
Lucene and servlet Integration
原标题:Lucene and servlet integration

我可能正在建造一个 Java服务器,需要与非常简单的卢塞内指数相结合。 该指数只可在一个领域查询,然后我要将结果退回,可能的话说XML,可能的话是JSON,但现在确实如此。 主要问题是指数本身不是一个问题。

我的问题是,两者应如何融合。 我的倾向是,从服务器上获取指数方案,因此,我管理该指数,将其储存在SerletContextListener。 然后,我可以建立一个简便的灯光,把搜索服务放在外。 我还可以有一份单一的材料,以照顾请求,并定期重建指数,然后将新指数换成旧指数。 产生的一个潜在问题是,如果指数在转换时,如何使该信箱的行为发生并等待仲裁。 这只需要不到二次,我可以在两场大赛中这样做,但我仍然认为这尽可能是防弹。 如果一个服务器要求服务,必须等待,则涉及什么时间。 我在什么地方和如何控制这种情况?

Other possibilities are to run the index as a standalone Java app, or to run it in a separate servlet app, and let the first app make http calls to it through a servlet. I don t see much benefit in the last approach, it just adds more code that doesn t really serve any purpose. There would be no reason for the search requests to be directly accessible from HTTP.

What are your thoughts? I appreciate any input from someone experienced along this line.

问题回答

需铭记的是,建议是建立一个单一<条码>IndexWriter。 我们走这条路,把它保留在保护区内,我们面临的一个问题是,用一台无法律约束力的轮胎,你有两台服务器,每台都想书写。 这就要求你要么支付过轻的履约惩罚,要么指定其中一人为作者。

如果你有两个以上的服务器,这个问题当然会变得更加尖锐。 但是,如果你再次谈论一个进程范围内的一切,那么这或许是令人担心的。

我鼓励你重新考虑Solr。 从某种意义上讲,它具有较大的特征,因此我可以理解,为什么你会认为它“过于熟练”,但通常会更快地建立并更容易使用——即纯卢塞特可能是高技能的。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签