示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlIndexWriter" /> class.
 /// </summary>
 /// <param name="profile">The profile to be used.</param>
 /// <param name="connFactory">The connection factory.</param>
 /// <param name="compiler">The SQL kata compiler to be used.</param>
 /// <exception cref="ArgumentNullException">profile or getConnection or
 /// compiler</exception>
 public SqlIndexWriter(
     EmbixProfile profile,
     IDbConnectionFactory connFactory,
     Compiler compiler) : base(profile)
 {
     _connFactory = connFactory
                    ?? throw new ArgumentNullException(nameof(connFactory));
     SqlCompiler = compiler
                   ?? throw new ArgumentNullException(nameof(compiler));
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IndexWriter"/> class.
        /// </summary>
        /// <param name="profile">The profile.</param>
        /// <exception cref="ArgumentNullException">profile</exception>
        protected IndexWriter(EmbixProfile profile)
        {
            Profile    = profile ?? throw new ArgumentNullException(nameof(profile));
            AutoNumber = new StandardAutoNumber();
            TokenIds   = new ConcurrentDictionary <Tuple <string, string>, int>();

            // setup the names
            RecordNames = new IndexRecordNames(
                new[] { "id", "value", "language" },
                GetOccurrenceFields());
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BufferedIndexWriter" />
 /// class.
 /// </summary>
 /// <param name="profile">The profile to be used.</param>
 /// <exception cref="ArgumentNullException">profile or getConnection or
 /// compiler</exception>
 protected BufferedIndexWriter(EmbixProfile profile) : base(profile)
 {
     _buffers     = new ConcurrentDictionary <int, IndexWriterBuffer>();
     _savedTokens = new ConcurrentDictionary <int, bool>();
     BufferSize   = 100;
 }