Hi Reza,
You will need to use the API like the sample below, however the sample does not take the page permissions into account and maybe some other things.
The snippet I found was the following:
private void LuceneSearch()
{
//Get the index searcher
SearchIndexInfo index = SearchIndexInfoProvider.GetSearchIndexInfo("TLSD_Content");
var searcher = index.GetSearcher(true);
//Get the search results for searched text
string term = "TLS";
Lucene.Net.Search.Query searchQuery = MultiFieldQueryParser.Parse(term, new[] { SearchHelper.CONTENT_FIELD }, new[] { BooleanClause.Occur.SHOULD }, new StandardAnalyzer());
var searchQueryFilter = new QueryFilter(searchQuery);
BitArray searchBitArray = searchQueryFilter.Bits(searcher.GetIndexReader());
//Get the search results for filter item
string classname = "tls.nieuws";
var qry1 = new TermQuery(new Lucene.Net.Index.Term("classname", classname));
var qryFilter = new QueryFilter(qry1);
BitArray qry1BitArray = qryFilter.Bits(searcher.GetIndexReader());
int total = GetCardinality(qry1BitArray);
//Combine the resuls
BitArray combinedResults = searchBitArray.And(qry1BitArray);
int total2 = GetCardinality(combinedResults);
}
Best regards,
Juraj Ondrus