Ejemplo n.º 1
0
 public override IEnumerable <object> Query(string propertyName, object propertyValue)
 {
     foreach (Document doc in LuceneIndex.Search(propertyName, propertyValue.ToString()))
     {
         yield return(doc.ToDynamicInstance(DynamicSearchResultTypeName));
     }
 }
Ejemplo n.º 2
0
        public override bool Delete(Type type, object toDelete)
        {
            bool result = PerformDelete(type, toDelete);

            LuceneIndex.UnIndex(toDelete);
            return(result);
        }
Ejemplo n.º 3
0
        public override object Create(Type type, object toCreate)
        {
            object result = PerformCreate(type, toCreate);

            LuceneIndex.Index(result);
            return(result);
        }
Ejemplo n.º 4
0
        public override IEnumerable <object> Query(Type type, Dictionary <string, object> queryParameters)
        {
            List <Document> results = new List <Document>();

            Parallel.ForEach(queryParameters.Keys, key =>
            {
                results.AddRange(LuceneIndex.Search(key, queryParameters[key].ToString()));
            });
            return(results.Select(d => d.ToDynamicInstance(DynamicSearchResultTypeName)));
        }
Ejemplo n.º 5
0
 public FsRepository(string rootDirectory)
 {
     RootDirectory = rootDirectory;
     LuceneIndex   = new LuceneIndex(IndexDirectory.FullName);
     DynamicSearchResultTypeName = $"{nameof(Repositories)}.{GetType().Name}SearchResult";
 }