Example #1
0
        public bool TryLoadProperty(PropertyDatabaseRecordKey recordKey, out object data)
        {
            if (propertyDatabaseView.TryLoad(recordKey, out data))
            {
                SearchMonitor.Log("Load property", recordKey, data);
                return(true);
            }

            SearchMonitor.Log("<color=red>Failed</color> to load property", recordKey);
            return(false);
        }
Example #2
0
 public bool TryLoadAlias(PropertyDatabaseRecordKey recordKey, out string alias)
 {
     if (!propertyAliasesView.TryLoad(recordKey, out object aliasObj))
     {
         SearchMonitor.Log("<color=red>Failed</color> to load alias", recordKey);
         alias = null;
         return(false);
     }
     alias = aliasObj as string;
     SearchMonitor.Log("Load alias", recordKey, alias);
     return(alias != null);
 }
Example #3
0
        public bool TryLoadProperty(ulong documentKey, string propertyName, out PropertyDatabaseRecordKey recordKey, out object value, out string alias)
        {
            var propertyHash = PropertyDatabase.CreatePropertyHash(propertyName);

            recordKey = PropertyDatabase.CreateRecordKey(documentKey, propertyHash);
            if (!propertyAliasesView.TryLoad(recordKey, out object aliasObj))
            {
                value = null;
                alias = propertyName;
                SearchMonitor.Log($"<color=red>Failed</color> to load {propertyName} without alias", recordKey, propertyName);
                return(false);
            }

            alias = (aliasObj as string) ?? propertyName;
            if (propertyDatabaseView.TryLoad(recordKey, out value))
            {
                SearchMonitor.Log($"Load property {propertyName}", recordKey, value);
                return(true);
            }

            SearchMonitor.Log($"<color=red>Failed</color> to load property {propertyName}", recordKey, propertyName);
            return(false);
        }
Example #4
0
 public void Invalidate(PropertyDatabaseRecordKey recordKey)
 {
     SearchMonitor.Log("Invalidate record", recordKey);
     propertyDatabaseView.Invalidate(recordKey);
     propertyAliasesView.Invalidate(recordKey);
 }
Example #5
0
 public void InvalidateDocument(string documentKey)
 {
     SearchMonitor.Log("Invalidate document");
     propertyDatabaseView.Invalidate(documentKey);
     propertyAliasesView.Invalidate(documentKey);
 }
Example #6
0
 public void StoreAlias(PropertyDatabaseRecordKey key, string alias)
 {
     propertyAliasesView.Store(key, alias);
     SearchMonitor.Log("Store alias", key, alias);
 }
Example #7
0
 public void StoreProperty(PropertyDatabaseRecordKey recordKey, object value)
 {
     propertyDatabaseView.Store(recordKey, value);
     SearchMonitor.Log("Store property", recordKey, value);
 }