You are here

query

The query element specifies the basic query to be parsed. This is the only mandatory parameter with any query.

Parameters

The parameters for the query element are:
Parameter Type Description Default value
language String The query language in which the query is written. The default search language is afts but cmis and lucene are also supported. See Alfresco Full Text Search Reference.
userQuery String The exact search request typed in by the user.  
query String The query which may have been generated in some way from the userQuery.  

Examples

Example 1: Here's a basic query that searches for the term lorem:
{
  "query": {
    "query": "lorem"
  }
}

The above example uses the default search language afts.

Example 2: Here's an example of a simple CMIS query:
{
  "query": {
    "query": "select * from cmis:folder",
    "language": "cmis"
  }
}
Example 3: Here's a simple CMIS query to find all content with a name starting with test:
{
  "query":{
    "query":"select * from cmis:document WHERE cmis:name LIKE 'test.%'",
    "language":"cmis"
  }
}
Example 4: Here's a simple lucene query to find all the content modified in the last week:
{
  "query":{
    "query":"+@cm\\:modified:[NOW/DAY-7DAYS TO NOW/DAY+1DAY] +TYPE:\"cm:content\"",
    "language":"lucene"
  }
}

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.