cancel
Showing results for 
Search instead for 
Did you mean: 

Categories vs types vs aspects

spilby
Confirmed Champ
Confirmed Champ
I'm using Alfresco 4.1.6 and Solr 1.4.

I'm reading about the possibility of using classifications for the nodes, specified with a type d:category in an aspect on the content model.

A good time of searchs in our project are the most important, is the reason I try to design the best option possible for this. Our repository have over 2 millions of documents, spread over directories, where each user (we have 3000 users aprox) have an own root path.

For the queries (FTS_ALFRESCO), we actually use TYPE (we have 5 distinct types of nodes defined on our model) and custom properties (all of them that we use in the queries are indexed).

Imagine I change my model and use one of our indexed properties like a category. I delete a property and create an aspect with d:category with this property. My question is…

The search will be more efficient and quickly if I search by TYPE, properties and category? Or really is the same than using type and properties? In other words, Alfresco gives me a best performance if I search this value like a category instead of when I search this value like a normal indexed property?  Whats the benefits of use this like a category?

Thanks!
3 REPLIES 3

raghav_bhardwaj
Champ on-the-rise
Champ on-the-rise
Hope this helps


Category searches use the PATH field, but you construct a path using the classification hierarchy. Suppose that sample-a.pdf is classified under "Languages/German", and sample-b.pdf is classified under "Languages/German/Swiss-German". Now consider the following two searches:
PATH:"/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German/*"
PATH:"/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German//*"
The first search will return sample-a.pdf because it is classified as "German" and the "Swiss-German" category. sample-b.pdf won't be returned because sample-b.pdf is under a subcategory, "Swiss-German". The second search uses double slashes ("//") at the end to denote that matches should include "German" as well as anything classified under a subcategory. It returns both documents and the "Swiss-German" subcategory.
So the category searches, as shown above, will return both objects that have been categorized ("members") and also the category nodes. If what you want are only documents and not categories, you can use "member" as follows:
PATH:"/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German/member"
PATH:"/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:German//member"
The first search would return only sample-a.pdf, while the second search would return sample-a.pdf and sample-b.pdf.




Please mark this comment useful if it is helpful for you.

Raghav Bhardwaj

I read that TYPE queries are faster than PATH queries. If I understand, is better not use PATH in a query if is possible. Better use TYPE or a property.

If Categories use PATH fields in the query… then is better not use categories for a quick search?

In other words… Category gives another possible PATH to obtain a document. It's like I have a document in two sites: the real path and the category path, and is useful to give to the user 2 ways to navigate and reach the document. But if I understand, don't give a best response time in the search, because PATH isn't recommended to seach elements. It's ok?

mrogers
Star Contributor
Star Contributor
Categories don't use path queries.  They have their own implementation and are optimized.