private ReflectionDocumentMapper(Version version, Analyzer externalAnalyzer, Type type)
        {
            this.externalAnalyzer = externalAnalyzer;
            this.version          = version;
            this.analyzer         = new PerFieldAnalyzer(new KeywordAnalyzer());

            var props = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);

            BuildFieldMap(props);

            BuildKeyFieldMap(type, props);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a new instance.
        /// If the supplied IndexWriter will be written to outside of this instance of LuceneDataProvider,
        /// the <paramref name="transactionLock"/> will be used to coordinate writes.
        /// </summary>
        public LuceneDataProvider(Directory directory, Analyzer externalAnalyzer, Version version, IIndexWriter externalWriter, object transactionLock)
        {
            this.directory        = directory;
            this.externalAnalyzer = externalAnalyzer;
            this.perFieldAnalyzer = new PerFieldAnalyzer(new KeywordAnalyzer());
            this.version          = version;
            this.writerIsExternal = externalWriter != null;
            this.writer           = externalWriter ?? IndexWriter;

            queryParser = RelinqQueryParserFactory.CreateQueryParser();
            context     = new Context(this.directory, transactionLock);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Constructs an instance with an externall supplied analyzer
 /// and the compatibility version of the index.
 /// </summary>
 /// <param name="version">Version compatibility for analyzers and indexers.</param>
 /// <param name="externalAnalyzer"></param>
 protected DocumentMapperBase(Version version, Analyzer externalAnalyzer)
 {
     this.version          = version;
     this.externalAnalyzer = externalAnalyzer;
     this.analyzer         = new PerFieldAnalyzer(new KeywordAnalyzer());
 }