Comments (7)
VersionInfo.cs is generated by psake.ps1.
I think both suggestions are useful and I tried to structure the code so that object/document mapping can be replaced or customized, but haven't exposed methods of swapping out replacements for the default reflection/attribute based mappers. Is your project public so I can look at it and get a better understanding of how it should work?
from lucene.net.linq.
There is a stub for the Indexer in my project at: https://github.com/mcintyre321/PieDb/blob/master/PieDb/Indexer.cs
The dynamic properties I am wanting to store along with the data are attached in PieIdExtension.cs, which uses a WeakReferenceTable to attach the database metadata to the object. it is this data which I need to retrieve after querying, so I can look up my objects.
from lucene.net.linq.
It looks like some way to override or add extra steps into the following methods would do the trick:
ReflectionDocumentMapper.ToDocument - then one could add extra items into the document
LuceneQueryExecutor.ConvertDocument - then one can replace or extend the object mapping process
Looking at the code, there are several ways to do this, the most obvious being to allow inherited types of the above classes, but that will involve making a lot of classes public. It might be worth just having a couple of delegates (e.g. ToDocumentDelegate, ConvertDocumentDelegate) properties on the LuceneDataProvider which can be replaced, which have default implementations the same as the methods.
One other suggestion - could the : new() constraint be removed, and a Factory Func<Type, object> be used instead? You can use (T) Activator.CreateInstance(typeof(T)) as a default and trade a little compiler safety for flexibility - particularly important if ConvertDocument can be switched out.
from lucene.net.linq.
LuceneDataProvider already has overloads for AsQueryable and OpenSession that accept a Func<T> delegate for creating new instances of T.
I'm looking at making IDocumentMapper and related interfaces and classes public and providing overloads on LuceneDataProvider to let you specify your own implementation.
from lucene.net.linq.
I've added overloads to LuceneDataProvider that accept an IDocumentMapper from the client. I've also made ReflectionDocumentMapper and ReflectionFieldMapper public with virtual implementations to facilitate decorating their behavior. (see commit c3702cd)
A preview package has been pushed to nuget.org at http://nuget.org/packages/Lucene.Net.Linq/3.1.44-preview
from lucene.net.linq.
Downloaded! Thanks!
On Wednesday, 6 February 2013, Chris Eldredge wrote:
I've added overloads to LuceneDataProvider that accept an IDocumentMapper
from the client. I've also made ReflectionDocumentMapper and
ReflectionFieldMapper public with virtual implementations to facilitate
decorating their behavior. (see commit c3702cdhttps://github.com/themotleyfool/Lucene.Net.Linq/commit/c3702cd89796f732aef98d3b03067f6ac87d0c77
)A preview package has been pushed to nuget.org at
http://nuget.org/packages/Lucene.Net.Linq/3.1.43-preview—
Reply to this email directly or view it on GitHubhttps://github.com/themotleyfool/Lucene.Net.Linq/issues/3#issuecomment-13189291.
from lucene.net.linq.
Thanks! My document db has search :)
from lucene.net.linq.
Related Issues (20)
- Netstandard upgrade HOT 1
- Lucene.net for .Net Core, is lucene.net.linq still a good choice compared with lucene query HOT 1
- LuceneDataProvider meant for single instance? HOT 1
- Session.Add overload for new documents HOT 11
- Issue with Contains() HOT 2
- Surface merge policy and related settings HOT 3
- Automatic / Reflection mapping HOT 1
- Query with a not-equals clause converts OR statements to AND HOT 4
- LuceneDataProvider keeps a lock on FSDirectory when not disposed HOT 6
- Unable to search within IEnumerable<int> field HOT 8
- Errors when searching DateTime fields HOT 6
- Unable to search within a nullable int field HOT 3
- Wildcard, Prefix and Fuzzy queries return no results HOT 3
- Dependancy update to Remotion.Linq HOT 4
- Lucene search;find only recently added data HOT 1
- common.logging upgrade HOT 1
- Search Generated Query HOT 1
- IEnumerable<string> and StartsWith
- QueryModelTranslator and QueryModelTransformer
- Unable to search NumericField
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucene.net.linq.