【问题标题】:Sitecore - get all indexed itemsSitecore - 获取所有索引项目
【发布时间】:2016-04-07 12:00:08
【问题描述】:

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

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

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

【问题讨论】:

    标签: lucene sitecore sitecore7


    【解决方案1】:

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

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

    【讨论】:

    • 感谢您的帮助 :)
    猜你喜欢
    • 1970-01-01
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多