private void AddUsings(Document doc, CSharpFileSyntax syntax) { foreach (var @using in syntax.Usings) { doc.Add(new Field(Fields.Using, @using, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); } }
private void AddComments(Document doc, CSharpFileSyntax syntax) { if (syntax.Comments.Any()) { var sb = new StringBuilder(); syntax.Comments.ForEach(c => sb.Append(c)); doc.Add(new Field(Fields.Comment, sb.ToString(), Field.Store.YES, Field.Index.ANALYZED)); } }
private void AddClasses(Document doc, CSharpFileSyntax syntax) { foreach (var @class in syntax.Classes) { doc.Add(new Field(Fields.Class, @class.ClassName, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); foreach (var @interface in @class.Interfaces) { doc.Add(new Field(Fields.Interface, @interface, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); } if (!string.IsNullOrEmpty(@class.BaseClassName)) { doc.Add(new Field(Fields.Base, @class.BaseClassName, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); } AddMethods(doc, @class); } }