cancel
Showing results for 
Search instead for 
Did you mean: 

get content by tags and search by tags

tmath1
Champ in-the-making
Champ in-the-making
1) Can you explain the uses cases for taggable versus tagscope aspects in wqs? 
2) Once you tag an item, how do you get a content by tag? Ex:  get all news in a channel that is tagged 'press release'.  I'm not sure where similar logic is in the wqs API.
3) Likewise, how can I extend the search feature of the site to search on a "phrase" plus "tag(s)"

The wqs product is pretty awesome.  i'm trying to deploy a 3500 page site in the next 2 months with several dynamic pages and functionality.  The concept of collections and the ability to use tags are very powerful to deliver the right content to the right places in the site.

Speaking of collections, is there any way to order the assets that are added to a static collection.  Use case: If we have 5 press releases in a given day, we may want to list them on the Indexpage with that appropriate prominence of each.  So item1.html will be that main focus of the page, while item 2 and 3 receive a second level of prominence.  The remaining items would just be shown in a list order.

Great forum here.  I'd sincerely appreciate your input.
5 REPLIES 5

bremmington
Champ on-the-rise
Champ on-the-rise
Glad you like Web Quick Start. I'll try to answer your questions:

1. The "taggable" aspect is used on the assets themselves, and allows tags to be applied to the asset. The "tagscope" aspect is used on sections (or, more generally, any folder) and is used to store "roll-up" information about tags used in (or anywhere below) that folder. For instance, it is the information held by the tagscope aspect that is used to show the tags and the asset count for each tag on some of the landing pages in the WQS sample site.

2. I'm not entirely sure which tier of the application you're referring to here. In WQS, tag values for an asset are flattened into a multi-valued text property named "ws:tags". You can see how the WQS API searches for assets with a certain tag by looking at the java-backed webscript called "AssetSearch". In this class we build up a Lucene query, using this snippet to limit results to those assets with a specified tag:

            if (tag != null && tag.length() != 0)
            {
                queryBuilder.append("+@ws\\:tags:\"");
                queryBuilder.append(tag);
                queryBuilder.append("\" ");
            }

3. You shouldn't have to extend the search feature to do this - it is supported. I haven't actually tested the snippet of code below, but I think it will do what you want  (I've used javascript on the assumption you'll be using it in a component controller, but it translates into java quite easily):

var query = section.createQuery();
query.setPhrase("Phrase to search for");
query.setTag("Tag to search for");
var results = section.search(query);

Unfortunately the answer to your final question about ordering of static asset collections is "no", at the moment. I understand that this is a weakness - I have addressed the problem for dynamic asset collections on HEAD, but static asset collections require a greater amount of surgery in the forms service to allow them to be ordered. For the time being I'm afraid you'll need to find another way. Sorry about that. Perhaps add a custom "order" property to your assets and have your editors use it to determine the order they are displayed?

tmath1
Champ in-the-making
Champ in-the-making
bremmington,

I sincerely appreciate your prompt reply.  Tags are such an important part of our site, especially for search.  In addition to our main site search, we will have section searches in some areas of the site.  For example, with in the news or hr landing pages, we may have a secondary search widget that searches only that section.  I was initially planning to utilize google mini and it's concept of collections, but I love the power and extensibility of Lucene as used in Alfresco.  I'll work on your recommendations and follow up with you.

It's too bad about ordering in collections.  I've already added a order by field in our content models but as you know that's a bit odd for most business users.  It's so much more intuitive to order items once they have been added to a static collection.  I'll let you know of any progress.

One other question.  I was reading a post earlier in which you said,
In my spare time I am also working on a more intelligent caching mechanism that will cache binaries in the web tier but automatically detect when a cached entity needs to be refreshed. Similar to what is done with the asset metadata and asset collections.

1) Have you made any progress on this?  If so please let me know and I'd like to take it into account to mitigate any performance issues, before we launch our site.  If not, I would love to hear you thoughts on how it can be accomplished, integrated into the current codeset and well as any known caveats.

I'm glad to create this as another post if you like.  Once again, thank you.  Most forums do not have such thorough replies and what seems to be a very enthusiastic and motivated team supporting it's efforts.  Keep up the great work.

bremmington
Champ on-the-rise
Champ on-the-rise
Please to hear that you find the forum useful. Thanks Smiley Happy

The code on HEAD does now have the enhanced asset caching that I mentioned in that earlier post. The caching asset factory now streams content via the local file system of the web tier, periodically checking the modified time of the asset in the repository to ensure that stale content is replaced with fresh as needed. I plan to put it through more testing over the next few months, but initial testing has been very positive, showing greater throughput and substantially lower CPU usage on the repo tier.

tmath1
Champ in-the-making
Champ in-the-making
Thanks bremmington.  I'll review.

andy
Champ on-the-rise
Champ on-the-rise
Hi

For alfresco tags (added via share for example) you can use

TAG:tag

in alfrecso FTS and the CONTENT() part fo CMIS queries.

Andy