0

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 :

  1. 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,

ERROR OCCURED WHILE CALLING ATOMIC UPDATE

And the record in my solr was also transformed to this, RECORD TRANSFORMED - ISSUE

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 SUCCESSFULLY UPDATED -

I've also researched on it, but no luck , I can't find any solution online

venalyn sudaria
  • 149
  • 1
  • 11

0 Answers0