M
M
Maxim Grechushnikov2016-01-09 01:33:24
PHP
Maxim Grechushnikov, 2016-01-09 01:33:24

Hiload: How to count documents in a hierarchy based on factors?

There is a list of document categories. Made in the form of Nested Sets
There is a list of documents. Many-to-many relationship.
Documents are added depending on factors: country, region, city.
How best to organize the storage of information about the number of documents so that you can
1. display a list of categories by country, region, city with information about the number of documents at EACH level of the hierarchy
2. the ability to filter by the number of documents
3. the ability sort. for example, display a list of popular categories in a particular city
at the moment using the total counter in a separate category field.
I thought to store counters in memcache or radish. but what is the best way to think over the structure there and how to sort and filter then?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question