public void RegisterSearchQuery(string query)
 {
     lock (this._searchLocker)
     {
         if (this._searchReferenceCount.ContainsKey(query))
         {
             this._searchReferenceCount[query]++;
         }
         else
         {
             this._searchReferenceCount.Add(query, 1);
             var receiver = new SearchReceiver(query);
             this._searchReceiverResolver.Add(query, receiver);
         }
     }
 }
 public void RegisterSearchQuery(string query, ICollection<long> receiveCache)
 {
     lock (this._searchLocker)
     {
         if (this._searchReferenceCount.ContainsKey(query))
         {
             this._searchReferenceCount[query]++;
         }
         else
         {
             var list = new List<ICollection<long>>();
             this._receiveCaches.Add(query, list);
             this._searchReferenceCount.Add(query, 1);
             var receiver = new SearchReceiver(query, list);
             this._searchReceiverResolver.Add(query, receiver);
         }
     }
     lock (this._receiveCaches[query])
     {
         this._receiveCaches[query].Add(receiveCache);
     }
 }