Iam using SOLR as my search query database. My current requirement is to post this Document on SOLR database.
namespace SOLRApp
{
public class Table1Document
{
public Table1Document()
{
MobileNos = new List<int>();
EducationalDetails = new List<EducationalDetails>();
}
[SolrUniqueKey("ID")]
public string ID { get; set; }
[SolrField("FirstName")]
public string FirstName { get; set; }
[SolrField("LastName")]
public string LastName{ get; set; }
[SolrField("MobileNos")]
public List<int> MobileNos { get; set; }
[SolrField("EducationalDetails")]
public List<EducationalDetails> EducationalDetails { get; set; }
}
public class EducationalDetails
{
public EducationalDetails()
{
Details = new List<Details>();
}
public List<Details> Details { get; set; }
}
public class Details
{
[SolrField("IntitutionName")]
public string IntitutionName { get; set; }
[SolrField("EnrollDate")]
public DateTime EnrollDate { get; set; }
[SolrField("PassoutDate")]
public DateTime PassoutDate { get; set; }
[SolrField("InstituteRating")]
public int InstituteRating { get; set; }
}
}
And for that I have added this schema file with field as follows.
<field name="ID" type="int" indexed="true" stored="true"/>
<field name="FirstName" type="string" indexed="true" stored="true"/>
<field name="LastName" type="string" indexed="true" stored="true" />
<field name="MobileNos" type="string" indexed="true" stored="true" multiValued="true" />
<field name="EducationalDetails" type="EducationalDetails" indexed="true" stored="true" multiValued="true">
<field name="Details" type="string" indexed="true" stored="true" multiValued="true">
<field name="IntitutionName" type="string" indexed="true" stored="true"/>
<field name="EnrollDate" type="date" indexed="true" stored="true"/>
<field name="PassoutDate" type="date" indexed="true" stored="true"/>
<field name="InstituteRating" type="string" indexed="true" stored="true"/>
</field>
</field>
I would like to know how can we add user defined datatypes in SOLR. Like in my example, 'EducationalDetails' is a user defined datatype (class). Can any one tell me how to add that in SOLR.
Thank you in advance.