Sitecore - get all indexed objects

I use lucene search to get bucket elements filtered by some string, and this is my code:

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

Is there some kind of query or something else that will allow me to get all indexed items? I tried with an empty "myString", but there is an error that it cannot be empty.

+4
source share
1 answer

You can use Lucene.Net.Search.MatchAllDocsQuery:

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

All Articles