I am new to solr and I am trying to implement a CRUD using SOLRNET.
I have a problem updating fields in solr using SolrNet - atomic Update, here's the problem :
- I am trying to update field "IsDeleted" and "IsSoldHidden" to solr using atomic update, here's what I've done.
public void SetIsDeleted(string id)
{
GetInstance().AtomicUpdate(id, new List<AtomicUpdateSpec>
{
new AtomicUpdateSpec("IsDeleted", AtomicUpdateType.Set, "true")
});
GetInstance().AtomicUpdate(id, new List<AtomicUpdateSpec>
{
new AtomicUpdateSpec("IsSoldHidden", AtomicUpdateType.Set, "true")
});
GetInstance().Commit();
}
public ISolrOperations<T> GetInstance()
{
try
{
return ServiceLocator.Current.GetInstance<ISolrOperations<T>>();
}
catch(Exception ex)
{
Logger.Error($"Unexpected error -> {ex.Message}", ex);
return null;
}
}
this code is perfectly working at 1st-2nd call, but when I tried it again to use it, to update a field, there was an error occured,
And the record in my solr was also transformed to this,
I don't know what happen. Am I doing it wrong ? Any ideas about it? Thanks
Here is my schema.xml
<field name="_version_" type="plong" indexed="false" stored="false"/>
<field name="IsDeleted" type="boolean" uninvertible="false" indexed="true" required="true" stored="true" multiValued="false"/>
<field name="IsManualSold" type="boolean" uninvertible="false" indexed="true" required="true" stored="true" default="false" multiValued="false"/>
<field name="IsSoldHidden" type="boolean" uninvertible="false" indexed="true" required="true" stored="true" multiValued="false"/>
<field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
and here is the record that is successfully updated
I've also researched on it, but no luck , I can't find any solution online