Exemplo n.º 1
0
        public static LuceneAction ToModel(this indexingQueue item)
        {
            var action = new LuceneAction
            {
                type          = (LuceneIndexType)item.type,
                subdomainName = item.MASTERsubdomain.name,
                deleteOnly    = item.deleteOnly,
                itemKey       = item.itemKey
            };

            switch (action.type)
            {
            case LuceneIndexType.CONTACTS:
                action.data = BaseQueueItem.Deserialize <ContactItem>(item.serializedItem);
                break;

            case LuceneIndexType.PRODUCTS:
                action.data = BaseQueueItem.Deserialize <ProductItem>(item.serializedItem);
                break;

            case LuceneIndexType.TRANSACTION:
                action.data = BaseQueueItem.Deserialize <TransactionItem>(item.serializedItem);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(action);
        }
Exemplo n.º 2
0
        public void AddActionToIndexingQueue(LuceneIndexType type, XElement data, long subdomainid, bool deleteOnly, long itemKey)
        {
            var single = new indexingQueue();

            single.subdomainid    = subdomainid;
            single.serializedItem = data;
            single.itemKey        = itemKey;
            single.deleteOnly     = deleteOnly;
            single.type           = (byte)type;

            db.indexingQueues.InsertOnSubmit(single);
        }