google-app-engine - 谷歌应用引擎 (GAE) 上的 Lucene

标签 google-app-engine lucene

我试图在 GAE 应用程序中使用 lucene,但是对于 lucene 3.1.0,即使使用 RAMDirectory(应该没问题,我只有大约 300 个文档要索引),我在提交或关闭索引时出错(见下文)。线索?

Caused by: java.lang.NullPointerException
at org.apache.lucene.store.IndexOutput.writeString(IndexOutput.java:103)
at org.apache.lucene.store.IndexOutput.writeStringStringMap(IndexOutput.java:221)
at org.apache.lucene.index.SegmentInfo.write(SegmentInfo.java:619)
at org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:381)
at org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:851)
at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4224)
at org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3161)
at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3232)
at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3214)
at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3198)

PS:当然可以在我的机器上运行

最佳答案

几个月前,我已经将其用于 App Engine:

http://ikaisays.com/2010/04/24/lucene-in-memory-search-example-now-updated-for-lucene-3-0-1/

部署到 App Engine 时,您是否保留对 RAMDirectory 的全局引用?这会产生问题,因为您没有单个 JVM——您可能有多个 JVM。请求 #1 可能会转到实例 A,它初始化内存中的索引,但请求 #2 可能会转到实例 B(不同的 JVM),该实例 B 仍然具有索引的空引用。这可能是正在发生的事情吗?

关于google-app-engine - 谷歌应用引擎 (GAE) 上的 Lucene,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6157726/

相关文章:

python - 使用 Python API 创建产品时未收到来自 Shopify 的响应

python - Google 应用引擎上的 Django : "Instance names cannot contain the ' :' character."

java - Lucene 搜索失败,出现异常 : ava. lang.IllegalStateException:字段的意外文档值类型为 NONE

java - Solr LatLonType multivalued=true,按多个点中最近的一个对文档进行排序

java - Lucene 搜索没有返回结果

search - 具有排除OR的嵌套过滤器查询

google-app-engine - 我可以在 Google Cloud End Point 中返回一个泛型吗

postgresql - 直接在 Google AppEngine 上使用 psycopg2

grails - 在Groovy中具有一对多关系的Lucene搜索问题

java - 日期查询不适用于 Google App Engine Java