AFTS Query doesn't work after adding Node?

Showing results for 
Search instead for 
Did you mean: 
Active Member

AFTS Query doesn't work after adding Node?

Hey Guys,

I have a method called "listData()" in which I query data from Alfresco with an AFTS query. When calling the method without anything has changed, the query workes fine. But when I add a Node like here:

and then call "listData()", the query doesn't give back the current created Node. That's a thing I do not understand because when I get the response from "createNode()" the Node should be successfully added to Database!

The query looks like this:

Do you have any Idea how to solve this issue?

2 Replies
Alfresco Employee

Re: AFTS Query doesn't work after adding Node?

I guess the query is using SOLR for searching and your are running the query just after the insertion. As SOLR is asynchronously indexing the content, the result is not available at this point. 

Probably this session by Axel Faust can help you to understand the whole thing: [BeeCon 2017] - Axel Faust - Making proper use of transactional metadata queries - YouTube 

Hyland Developer Evangelist

Re: AFTS Query doesn't work after adding Node?

Note that if you were to use CMIS for this type of query (date range, though without any fancy date math expressions) than Alfresco would be able to execute the query against the DB and you should have a consistent result immediately. Unfortunately Alfresco "forgot" to handle the necessary query rewrite logic for AFTS to support (a limited sub-set of) range queries against the DB.