Hi Thorsten,

Thorsten Scherler schrieb:
I need to implement some ContentFiltering widgets for a lenya
publication. The widgets are basically selects over certain MetaData
fields on specific resource types.

Our publication is focused on events of a certain region. You can add
events to certain categories and later on edit their content. This
events use meta data that allows filtering like place, start date, end
date, etc.

One specific widget is e.g. cities. The containing options are all
cities of the different events (the duplicates removed). Clicking on the
filter will result in a listing of all events for that city.

What is the preferred method in lenya to get all documents of a certain
resource type?

I guess the most performant way is to use Lucene. The query would be:

{http://apache.org/lenya/metadata/document/1.0}resourceType:foobar

See also

https://lenya.zones.apache.org/cms/docu/authoring/docu20/reference/metadata.html#N100BF

A while ago I started to implement a convenient API to do such queries, see thread "API for document search" on the users list. Maybe we can discuss this again?

How can I control the caching of the this call, since I can use a cached
version of the listing until one of the documents get edit?

The Lucene query should be pretty fast, so caching the resulting list might not be necessary.

If you don't want to use Lucene, you could write a custom generator that stores an index of the relevant meta data and uses the last modification date for the cache validity. The generator also has to check the sitetree to see if documents have been added or removed. This is a rather complex task, but we used it for a customer in Lenya 1.2 and up to now it works very well (in combination with mod_cache, though).

HTH,

-- Andreas


--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lenya.apache.org
For additional commands, e-mail: dev-h...@lenya.apache.org

Reply via email to