diff --git a/core/service.go b/core/service.go index d2878f609..2dce383b8 100644 --- a/core/service.go +++ b/core/service.go @@ -48,7 +48,7 @@ func NewService() *Service { service.WebService = NewWebService(service) service.Index = index.NewFragmentContainer() service.Hold = hold.NewHolder() - service.version = "0.0.21" + service.version = "0.0.22" service.name = "Cruncher" service.PrepareLogging() fmt.Printf("Pilosa %s\n", service.version) diff --git a/index/brand.go b/index/brand.go index cde080e4c..3c40f26a5 100644 --- a/index/brand.go +++ b/index/brand.go @@ -85,7 +85,7 @@ func (self *Brand) cache_it(bm IBitmap, bitmap_id uint64, category uint64) { if bm.Count() >= self.threshold_value { self.bitmap_cache[bitmap_id] = &Rank{&Pair{bitmap_id, bm.Count()}, bm, category} if len(self.bitmap_cache) > self.threshold_length { - log.Printf("RANK: %d %d", len(self.bitmap_cache), self.threshold_length) + log.Printf("RANK: %d %d %d", len(self.bitmap_cache), self.threshold_length, self.threshold_value) self.Rank() self.trim() } @@ -93,10 +93,11 @@ func (self *Brand) cache_it(bm IBitmap, bitmap_id uint64, category uint64) { } func (self *Brand) trim() { for k, item := range self.bitmap_cache { - if item.bitmap.Count() < self.threshold_value { + if item.bitmap.Count() <= self.threshold_value { delete(self.bitmap_cache, k) } } + log.Printf("TRIM: %d %d", len(self.bitmap_cache), self.threshold_length) } @@ -134,7 +135,7 @@ func (self *Brand) Rank() { item := list[self.threshold_idx] self.threshold_value = item.bitmap.Count() } else { - self.threshold_value = 0 + self.threshold_value = 1 } //dump(self.rankings, 10)