public override IEnumerable <object> Query(string propertyName, object propertyValue) { foreach (Document doc in LuceneIndex.Search(propertyName, propertyValue.ToString())) { yield return(doc.ToDynamicInstance(DynamicSearchResultTypeName)); } }
public override bool Delete(Type type, object toDelete) { bool result = PerformDelete(type, toDelete); LuceneIndex.UnIndex(toDelete); return(result); }
public override object Create(Type type, object toCreate) { object result = PerformCreate(type, toCreate); LuceneIndex.Index(result); return(result); }
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))); }
public FsRepository(string rootDirectory) { RootDirectory = rootDirectory; LuceneIndex = new LuceneIndex(IndexDirectory.FullName); DynamicSearchResultTypeName = $"{nameof(Repositories)}.{GetType().Name}SearchResult"; }