Пример #1
0
        public IEnumerable <int> FindRows(string filter)
        {
            checkloaded();
            WAHBitArray bits = ExecutionPlan(filter, _docs.RecordCount());

            // enumerate records
            return(bits.GetBitIndexes());
        }
Пример #2
0
        public IEnumerable <string> FindDocumentFileNames(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);
                //var d = (Dictionary<string, object>)fastJSON.JSON.Parse(b);//fastJSON
                //yield return d["FileName"].ToString();
                var d = _json.DeserializeObject <Document>(b);
                yield return(d.FileName);
            }
        }
Пример #3
0
        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 }); //fastJSON
                T d = _json.DeserializeObject <T>(b);

                yield return(d);
            }
        }