コード例 #1
0
        /// <summary>
        /// Gets the index builder.
        /// </summary>
        /// <param name="logger">The optional logger to use.</param>
        /// <returns>The index builder.</returns>
        public IndexBuilder GetBuilder(IMetadataSupplier supplier, ILogger logger)
        {
            EmbixProfile profile = new EmbixProfile(_profileCode, GetFactory());

            IIndexWriter writer = GetIndexWriter();

            writer.Logger           = logger;
            writer.MetadataSupplier = supplier;

            return(new IndexBuilder(profile, _connFactory, writer)
            {
                Logger = logger
            });
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IndexBuilderFactory"/> class.
        /// </summary>
        /// <param name="profile">The profile.</param>
        /// <param name="compiler">The compiler.</param>
        /// <param name="additionalAssemblies">The optional additional assemblies
        /// to look for filters and tokenizers.</param>
        /// <exception cref="ArgumentNullException">compiler or profile</exception>
        protected IndexBuilderFactory(
            string profile,
            IDbConnectionFactory factory,
            Compiler compiler,
            params Assembly[] additionalAssemblies)
        {
            _profileCode = profile ?? throw new ArgumentNullException(nameof(profile));
            _connFactory = factory ?? throw new ArgumentNullException(nameof(factory));
            SqlCompiler  = compiler ?? throw new ArgumentNullException(nameof(compiler));

            BufferSize = 100;

            _configuration = new ConfigurationBuilder()
                             .AddInMemoryJson(profile).Build();
            _addAssemblies = additionalAssemblies;

            Profile = new EmbixProfile(profile, GetFactory());
        }