Search code examples
c#.netsolrsolrnet

Which changes in Solr schema and/or in mapped class are breaking?


We are using Solr by SolrNet package with default attributes-based mapping.

public class MyType
{
    [SolrUniqueKey("id")]
    public int Id { get; set; }

    [SolrField("name")]
    public string Name { get; set; }

    //[SolrField("new_field")]
    //public string NewField { get; set; }
}

Which of those changes will be breaking for the application that use it?

  1. Adding new field to the existing core schema without reindexing with code left intact.
  2. ... the same as above... with reindexing that populate new fields.
  3. Adding new property to mapped class keeping Solr schema intact.

Solution

  • None of those are breaking.

    1. If Solr field is present only in mapping, but not in Solr documents - clients will have null as a value.
    2. if Solr sends some extra fields that are not in the mapping class they will be simply ignored.