在 lucene 中,我可以执行以下操作
doc.GetField("mycustomfield").StringValue();
Run Code Online (Sandbox Code Playgroud)
这将检索索引文档中列的值。
我的问题,同样的'doc',有没有办法得到Doc. Id?卢克展示了它,因此必须有办法解决这个问题。我需要它来删除有关更新的文档。
我搜索了文档,但没有找到在 GetField 中使用的术语,或者是否已经有另一种方法。
我需要知道Solr结果中文档的位置.让我解释一下原因.我们希望在搜索中向用户显示其项目的位置(以便用户可以购买促销并将其移动).现在我查询所有页面,直到找到文档,但它会生成很多对Solr的调用.有没有办法获取元素的id和查询位置?最好通过id列表,以便我可以一次查询.
示例查询:
/search?sort=sort_time%20desc&fq=category_parent_id:2003&rows=15&q=&start=0
Run Code Online (Sandbox Code Playgroud)
样本文件:
{
sort_time: 1421747930,
id: 146002852,
catlevel2: "Volvo",
catlevel1: "Auto's",
description: "Volvo XC90",
score: 6.4758344
}
Run Code Online (Sandbox Code Playgroud)