Git Product home page Git Product logo

Comments (7)

chriseldredge avatar chriseldredge commented on June 2, 2024

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.

mcintyre321 avatar mcintyre321 commented on June 2, 2024

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.

mcintyre321 avatar mcintyre321 commented on June 2, 2024

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.

chriseldredge avatar chriseldredge commented on June 2, 2024

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.

chriseldredge avatar chriseldredge commented on June 2, 2024

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.

mcintyre321 avatar mcintyre321 commented on June 2, 2024

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.

mcintyre321 avatar mcintyre321 commented on June 2, 2024

Thanks! My document db has search :)

from lucene.net.linq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.