int length3 = CheckBoxList4.Items.Count;
int count = 0;
for (int i = 0; i < length3; i++)
{
BooleanQuery finalQuery1 = new BooleanQuery();
finalQuery1 = (BooleanQuery)Session["Luc_Query"];
var query1 = new QueryParser("Industry", analyzer).Parse(CheckBoxList4.Items[i].Text);
finalQuery1.Add(query1, BooleanClause.Occur.MUST);
hits = searcher.Search(finalQuery1);
count = hits.Length();
CheckBoxList4.Items[i].Text = CheckBoxList4.Items[i].Text +" " +count.ToString() ;
}
我试图使 finalQuery1 为空,但它重复了这个的附加值。query(finalQuery1.Add(query1, BooleanClause.Occur.MUST);)
我用来使 BooleanQuery 为空的方法在下面,但它仍然无法正常工作。
finalQuery1 = (BooleanQuery)null;
finalQuery1=null;