コード例 #1
0
        public override IEnumerable <Row> Execute(IEnumerable <Row> rows)
        {
            using (var reader = LuceneReaderFactory.Create(_luceneConnection, _entity, true)) {
                var docCount = reader.NumDocs();

                for (var i = 0; i < docCount; i++)
                {
                    if (reader.IsDeleted(i))
                    {
                        continue;
                    }

                    var doc = reader.Document(i, new MapFieldSelector(_selected));

                    var row = new Row();

                    foreach (var field in _fields)
                    {
                        row[field.Alias] = Common.ConversionMap[field.SimpleType](doc.Get(_input ? field.Name : field.Alias));
                    }

                    yield return(row);
                }
            }
        }
コード例 #2
0
 public static IndexSearcher Create(AbstractConnection connection, Entity entity)
 {
     return(new IndexSearcher(LuceneReaderFactory.Create(connection, entity, true)));
 }