コード例 #1
0
ファイル: IndexSets.cs プロジェクト: vivekshimpi01/lucene.net
        /// <summary>
        /// Returns an IndexSet object for a given IndexDocument id value
        /// </summary>
        /// <param name="deleteId">Id value of the IndexDocument</param>
        /// <returns>The IndexSet containing the referenced IndexDocument</returns>
        public IndexSet GetIndexSet(int deleteId)
        {
            IndexSet getSet = null;

            foreach (IndexSet idxSet in this._arIndexSet)
            {
                if ((deleteId >= idxSet.BottomId) && (deleteId <= idxSet.TopId))
                {
                    getSet = idxSet;
                }
            }
            return(getSet);
        }
コード例 #2
0
ファイル: IndexSets.cs プロジェクト: vivekshimpi01/lucene.net
        /// <summary>
        /// Strongly-typed array of IndexSet objects as defined in a configuration section.
        /// </summary>
        /// <param name="node">XmlNode definition for a given IndexSet</param>
        public void LoadIndexSetArray(XmlNode node)
        {
            XmlAttributeCollection attributeCollection = node.Attributes;

            try
            {
                this._bCompoundFile = Convert.ToBoolean(attributeCollection["CompoundFile"].Value);
            }
            catch (Exception)
            {
                throw new ConfigurationErrorsException("CompoundFile invalid: " + Environment.NewLine + node.OuterXml);
            }

            try
            {
                this._strDeltaDirectory = attributeCollection["DeltaDirectory"].Value;
            }
            catch (Exception)
            {
                throw new ConfigurationErrorsException("DeltaDirectory invalid: " + Environment.NewLine + node.OuterXml);
            }

            if (node.ChildNodes.Count == 0)
            {
                throw new ConfigurationErrorsException("No indexset definitions found " + Environment.NewLine + node.OuterXml);
            }
            this._arIndexSet = new IndexSet[node.ChildNodes.Count];

            int x = 0;

            foreach (XmlNode c in node.ChildNodes)
            {
                if (c.Name.ToLower() == "IndexSet")
                {
                    IndexSet idxSet = new IndexSet(c);
                    this._arIndexSet[x] = idxSet;
                    x++;
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Strongly-typed array of IndexSet objects as defined in a configuration section.
        /// </summary>
        /// <param name="node">XmlNode definition for a given IndexSet</param>
        public void LoadIndexSetArray(XmlNode node)
		{
			XmlAttributeCollection attributeCollection = node.Attributes;

            try
            {
                this._bCompoundFile = Convert.ToBoolean(attributeCollection["CompoundFile"].Value);
            }
            catch (Exception)
            {
                throw new ConfigurationErrorsException("CompoundFile invalid: " + Environment.NewLine + node.OuterXml);
            }

            try
            {
                this._strDeltaDirectory = attributeCollection["DeltaDirectory"].Value;
            }
            catch (Exception)
            {
                throw new ConfigurationErrorsException("DeltaDirectory invalid: " + Environment.NewLine + node.OuterXml);
            }

            if (node.ChildNodes.Count == 0)
                throw new ConfigurationErrorsException("No indexset definitions found " + Environment.NewLine + node.OuterXml);
            this._arIndexSet = new IndexSet[node.ChildNodes.Count];
            
			int x=0;
			foreach (XmlNode c in node.ChildNodes)
			{
				if (c.Name.ToLower()=="IndexSet")
				{
					IndexSet idxSet = new IndexSet(c);
					this._arIndexSet[x] = idxSet;
					x++;
				}

			}
		}