public IndexPredefinition ToIndexPredefinition()
        {
            IndexPredefinition IndexPreDef = new IndexPredefinition(this.Name);

            IndexPreDef.SetComment(this.Comment);
            IndexPreDef.SetEdition(this.Edition);
            IndexPreDef.SetIndexType(this.IndexType);
            if (this.IndexOptions != null)
            {
                IndexPreDef.AddOptions(this.IndexOptions);
            }

            if (this.Properties != null)
            {
                foreach (var Property in this.Properties)
                {
                    IndexPreDef.AddProperty(Property);
                }
            }

            IndexPreDef.SetVertexType(this.VertexTypeName);

            return IndexPreDef;
        }
Пример #2
0
        public override IQueryResult Execute(IGraphDB myGraphDB, 
                                            IGraphQL myGraphQL, 
                                            GQLPluginManager myPluginManager, 
                                            String myQuery, 
                                            SecurityToken mySecurityToken, 
                                            Int64 myTransactionToken)
        {
            Query = myQuery;

            var indexDef = new IndexPredefinition(_IndexName, _DBType)
                                .SetIndexType(_IndexType)
                                .SetEdition(_IndexEdition);
            
            //to be indices attributes
            foreach (var aIndexedProperty in _AttributeList)
            {
                indexDef.AddProperty(aIndexedProperty.IndexAttribute.ContentString);
            }

            //options for the index
            if (_options != null)
            {
                foreach (var aKV in _options)
                {
                    indexDef.AddOption(aKV.Key, aKV.Value);
                }
            }

            return myGraphDB.CreateIndex<IQueryResult>(mySecurityToken, myTransactionToken, new RequestCreateIndex(indexDef), GenerateResult);
        }