cancel
Showing results for 
Search instead for 
Did you mean: 

Compare property values using FTS query search?

darkstar1
Confirmed Champ
Confirmed Champ

Is it possible to compare property values using the fts (or cmis) query language? I have tried the following:

{
    "query": {
      "query": "TYPE:'my:type' AND (cm:name != my:prop)",
			"language": "afts"
    },
  "include": ["properties"],
  "paging": {
    "maxItems": "1000",
    "skipCount": "0"
  }
}

And :

{
    "query": {
      "query": "SELECT * FROM my:type WHERE my:prop IS NOT NULL AND my:prop <> cm:name",
			"language": "cmis"
    },
   
  "include": ["properties"],
  "paging": {
    "maxItems": "1000",
    "skipCount": "0"
  }
}
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

AFTS on SOLR could theoretically support something like this using conditions with query functions, but you could very likely not use the short prefix names, which need translation to proper field names by Alfresco, and likely only work in those "typical" and supported use cases of regular searches.

CMIS QL should support this as column references can be used on either side of an operator. Though of course you cannot use cm:name and have to use cmis:name, and obviously have to deal with table aliases when doing joins on aspects and stuff.

In any case, I seriously doubt anyone else has every tried any of those approaches. My money is on "FTS = no way", and "CMIS = maybe if you correct your query"