1. I have documents that refer to property values from multiple custom aspects. I would like to know if I can do a CMIS type search on different properties using AND or OR criteria similar to in a lucene query.
2. With lucene search, I only need to specify the various property and its values to search for , and its able to return document matches successfully, but with CMIS do I have to specify the aspect names explicitly within my queries and do a join between them. Can I do a generic CMIS query search that will be able to search for documents with matching property values across multiple aspects
Example CMIS query that I would like to achieve
I have OrderAspect - has properties orderId, ordername, orderType
I have CustomerAspect - has customer name, customer state, customer type, customer id
I have a DiscountAspect - has discount type , discount percentage (can be 5 percent or 10 percent)
I want to have a CMIS query that gets all documents that have aspect property values where orderType is 'Boxes, have customerName as 'Peter' and have been given discount percentage of '5 percentage'
NEVER do a Lucene search. Lucene is a legacy search language only included for low-level technical use cases. Only ever user FTS or CMIS QL.
In CMIS QL you can use AND / OR for conditions on different properties, but you cannot use OR to select different types / aspects as these are always selected via the FROM clause which only supports restricting, not broadening of scopes.
As for your example use case, since you are only using AND to join the conditions, it would work with CMIS. You'd select FROM cmis:document, then JOIN with each of the aspects to able to select those properties.
Thanks Jeff Potts . The only downside I see to using CMIS query is that I have to know the specific aspect types for each of the properties that I am searching. I want to make a generic search query that can take property fields that could belong to different aspect types and search for values against them? Is this possible using CMIS query language? Can I use FTS query within CMIS and is there a way around the above issue?
CMIS provides a dictionary that you can use to lookup the aspect for a specific property. So you can write generic code that builds the CMIS query with all the JOINs that you need and in your client code simply just specify the properties you want to query on. One of my customers has been working with CMIS in that way for years, based upon a small library they wrote for their use which did the query generation.
Thanks Axel Faust , I tried searching for CMIS dictionary but couldn't find any reference to how to access the dictionary. Can you please point me to any reference material or let me know to get access it, would be really helpful.
Check the CMIS Repository services. You'll have to iterate through all types to find your properites, but this can be done once to build a local cache of the dictionary, and then you have a direct lookup of properties to their type (primary / secondary = aspect)