为什么我在用SORT类进行排序时出错.
提示:field "id" does not appear to be indexed
code:
_________________________________________________
IndexSearcher seo = new IndexSearcher(Application.StartupPath + "\\index\\");
Query q = QueryParser.Parse(textBox1.Text,"body",new SimpleAnalyzer());
Lucene.Net.Search.Sort s = new Sort("id");
Hits hs = seo.Search(q,s);
...........................
___________________________________________________
索引部分:
Document dc = new Document();
dc.Add(Field.Text("id",dt.Rows[i][0].ToString()));
dc.Add(Field.Text("title",dt.Rows[i][1].ToString()));
dc.Add(Field.Text("body",seg.SegmentText(dt.Rows[i][2].ToString(),true)));
iw.AddDocument(dc);