public IEnumerable <int> FindRows(string filter) { WAHBitArray bits = ExecutionPlan(filter, _docs.RecordCount()); // enumerate records return(bits.GetBitIndexes()); }
public IEnumerable <string> FindDocumentFileNames(string filter) { WAHBitArray bits = ExecutionPlan(filter, _docs.RecordCount()); // enumerate documents foreach (int i in bits.GetBitIndexes()) { if (i > _lastDocNum - 1) { break; } string b = _docs.ReadData(i); var d = (Dictionary <string, object>)fastJSON.JSON.Parse(b); yield return(d["FileName"].ToString()); } }
public IEnumerable <Document> FindDocuments(string filter) { WAHBitArray bits = ExecutionPlan(filter, _docs.RecordCount()); // enumerate documents foreach (int i in bits.GetBitIndexes()) { if (i > _lastDocNum - 1) { break; } string b = _docs.ReadData(i); Document d = fastJSON.JSON.ToObject <Document>(b); yield return(d); } }
public IEnumerable <T> FindDocuments <T>(string filter) { checkloaded(); WAHBitArray bits = ExecutionPlan(filter, _docs.RecordCount()); // enumerate documents foreach (int i in bits.GetBitIndexes()) { if (i > _lastDocNum - 1) { break; } string b = _docs.ReadData(i); T d = fastJSON.JSON.ToObject <T>(b, new fastJSON.JSONParameters { ParametricConstructorOverride = true }); yield return(d); } }