I have following setup:
Have CF items and CF keywords.
Each item have zero, one or more keywords, stored in columns.
Each keyword have one or more items, stored in columns.
It looks like this:
items { dl { name => DELL6400, keyword:1 => computer, keyword:2 => DELL, keyword:3 => topseller } hp { name => HP12345, keyword:1 => computer, keyword:2 => HP } no { name => Nokia8210, keyword:1 => phone, keyword:2 => NOKIA } } // here I store keys of the items only, // in reality I have denormalized most of items columns keywords{ computer { webpage => www.domain.com/computer , item:dl => dl , item:hp => hp } DELL { webpage => www.domain.com/dell , item:dl => dl } topseller { webpage => www.domain.com/top , item:dl => dl } HP { webpage => www.domain.com/hp , item:hp => hp } NOKIA { webpage => www.domain.com/nokia , item:no => no } phone { webpage => www.domain.com/phone , item:no => no } }
when I add new item, I am adding "webpage" column in keywords if neccessary.
when I am removing an item, I am removing column "item:xx" as well
question is how to avoid "empty" keywords such if I remove nokia item "no":
keywords{ ... NOKIA { webpage => www.domain.com/nokia } phone { webpage => www.domain.com/phone } }
I can count slice item:*, but because of eventual consistency this will be probably wrong aproach.