Enonic version: 6.15.5
OS: Linux
I have a simple query:
query = "fulltext('_allText', 'test~0', 'AND')";
This works fine. However, I want to order the results based on modifiedDate, so I added this:
query = "fulltext('_allText', 'test~0', 'AND') ORDER BY modifiedTime DESC";
This looks like a valid query based on all the examples I can find in the documentation, but when I execute the query I get this error:
line 1, column 42: AND, OR or EOF expected, ORDER encountered. (com.enonic.xp.resource.ResourceProblemException)
This is the context, in case it’s relevant:
var results = libs.content.query({
start: start,
count: postsPerPage,
query: query, // <- "fulltext('_allText', 'test~0', 'AND') ORDER BY modifiedTime DESC"
contentTypes: [
app.name + ':article',
app.name + ':employee',
app.name + ':employeeList',
app.name + ':landing-page',
app.name + ':seminar',
app.name + ':articlesCategory'
]
});
What am I doing wrong here?