コード例 #1
0
ファイル: SolrCore.cs プロジェクト: CHAOS-Community/Portal
        /// <summary>
        /// Convert an Indexable item to a solr document
        /// </summary>
        /// <param name="item">the object to index</param>
        /// <returns></returns>
        public static XElement ConvertToSolrDocument(IIndexable item)
        {
            var doc = new XElement("doc");

            foreach (var field in item.GetIndexableFields())
            {
                doc.Add(new XElement("field", new XAttribute("name", field.Key), field.Value.Replace("<", " ")));
            }

            return doc;
        }