private static Dirent DocumentToDirent(Document doc)
{
string path;
bool is_dir = false;
path = doc.Get ("Uri");
string prop_key = "prop:k:" + Property.IsDirectoryPropKey;
foreach (Field f in doc.Fields ()) {
if (f.Name () != prop_key)
continue;
// Format of fields: from LuceneCommon.cs:AddPropertyToDocument
is_dir = (f.StringValue ().Substring (3) == "true");
break;
}
//Logger.Log.Debug ("Found: " + path + " (" + is_dir + ")");
return new Dirent (path, is_dir);
}