【发布时间】:2009-08-25 13:46:03
【问题描述】:
我目前正在使用 lucene 索引数据库。我正在考虑将表 ID 存储在索引中,但我找不到按该字段检索文档的方法。我想一些伪代码会进一步澄清这个问题:
document.add("_id", 7, Field.Index.UN_TOKENIZED, Field.Store.YES);
// How can I query the document with _id=7
// without getting the document with _id=17 or _id=71?
【问题讨论】:
-
您使用的是哪个版本的 Lucene API?您使用的是哪种方法(从 Lucene 2.4 开始,Document.add() 采用 Fieldable)?
-
我实际上使用的是 php 端口(由 Zend 提供),但不知道这可能会有所不同,因为查询语法应该相同。
-
查询语法不同。原则依旧。作为 php 的移植,Zend 目前支持 Lucene 2.3,比当前的 Java Lucene 版本大约落后两个版本。
-
好的,非常感谢,我不知道。
标签: php zend-framework lucene