gpt4 book ai didi

lucene - Sitecore - 获取所有索引项目

转载 作者:行者123 更新时间:2023-12-01 03:33:19 27 4
gpt4 key购买 nike

我正在使用 lucene 搜索来获取由某个字符串过滤的存储桶项目,这是我的代码:

var innerQuery = new FullTextQuery(myString);
var hits = searchContext.Search(innerQuery, searchIndex.GetDocumentCount());

是否有一些查询或不同的东西可以让我获得所有索引项目?我尝试使用空的“myString”,但有一个错误,它不能为空。

最佳答案

您可以使用 Lucene.Net.Search.MatchAllDocsQuery :

SearchHits hits = searchContext.Search(new MatchAllDocsQuery(), int.MaxValue);

关于lucene - Sitecore - 获取所有索引项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36475553/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com