How to upload Nested Object Collections To solr using solr.net and C#

hamza dev 1 Reputation point
2022-10-27T10:17:00.88+00:00

i have created this class to update it to schemaless solr Core

public class PendingQueueProcessingCore
{
[SolrField("QueueID")]
public int QueueID { get; set; }

    [SolrField("ListID")]  
    public List<int> ListID { get; set; }  
    [SolrField("MatchingMethods")]  
    public List<string> MatchingMethods { get; set; }   
    [SolrField("ClientID")]  
    public string ClientID { get; set; }  
    [SolrField("ScreeningAgainst")]  
    public string ScreeningAgainst { get; set; }  
    [SolrField("CompanyID")]  
    public int CompanyID { get; set; }  
    [SolrField("Priority")]  
    public bool Priority { get; set; }  
    [SolrField("status")]  
    public PendingQueueProcessingStatus status { get; set; }  
    [SolrField("CreatedOn")]  
    public DateTime? CreatedOn { get; set; }  
    [SolrField("ProcessingStartAt")]  
    public DateTime? ProcessingStartAt { get; set; }  
    [SolrField("ProcessingEndAt")]  
    public DateTime? ProcessingEndAt { get; set; }  
    [SolrField("errorLogsJson")]  
    public string errorLogsJson  
    {  
        get { return JsonConvert.SerializeObject(ErrorLogs); }  
        set  
        {  

            ErrorLogs = JsonConvert.DeserializeObject<List<ErrorLog>>(value);  
        }  
    }  

    [SolrField("MaxRows")]  
    public int maxRows { get; set; }  

    [SolrField("details")]  
    public Dictionary<string, object> details { get; set; }  

    [SolrField("errorLogs")]  
    public ICollection<ErrorLog> ErrorLogs { get; set; } = new List<ErrorLog>();  
    [SolrUniqueKey("id")]  
    [JsonIgnore]  
    public string id { get; set; }  
    [JsonIgnore]  
    [SolrField("_version_")]  
    public long _version_ { get; set; }  

    public class ErrorLog  
    {  
        [SolrUniqueKey("id")]  
        [JsonIgnore]  
        public string id { get; set; }  
        [SolrField("ErrorPath")]  
        public string ErrorPath { get; set; }  
        [SolrField("Error")]  
        public string Error { get; set; }  
        [SolrField("StackTrace")]  
        public string StackTrace { get; set; }  
        public DateTime CreatedOn { get; set; }  
        public string CompanyID { get; set; }  
        public string EPriority { get; set; }  
    }   
}
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,306 questions
0 comments No comments
{count} votes