Hello!
I want to search node by property using Lucene and not wait while property cache was updated after 1min or more. (In case with many nodes this time may be longer that 5 mins) Cache update required only for one webscript action and not for whole nodes. May be exist method for force-update node cache or somethis else like this. Ill be happy if exist some lifehack who can make this thing.
System info :
Alfresco Platform: 5.2.g
Alfresco Share: 5.2.f
Solved! Go to Solution.
There are a couple of things wrong in the question. Alfresco is not using (low-level) Lucene directly anymore in 5.2.g - instead you are dealing with SOLR, which is architecturally a separate application. The synchronisation / indexing is done using a pull-approach and triggered by a schedueld process in SOLR. For that very reason, there will always be asynchronocity between updates to the DB and the state that can be searched via SOLR.
Furthermore, a "property cache" has nothing to do with performing searches. The property cache on the Repository tier is only used to re-use already loaded property values to avoid costly DB round-trips when the same node is read multiple times without changes between those reads. SOLR indexing is independent of that cache as it always gets its data from the database, circumventing the cache to ensure it does not get stale data or flood the cache, thereby purging any data the users are currently using from the cache.
Alfresco has introduced transactional metadata query support in Alfresco 4.2, which was further enhanced in Alfresco 5.1. With that, you can write Alfresco FTS queries that can be executed against the database, and don't have to wait for any asynchronous update process, as long as your query conforms with some requirements (exact-match oriented conditions, no use of index-only query fields...).
That feature also does not use any property cache to perform the search operation. Nothing needs to be forced. As soon as the data has been updated on the DB, it can be queried.
There are a couple of things wrong in the question. Alfresco is not using (low-level) Lucene directly anymore in 5.2.g - instead you are dealing with SOLR, which is architecturally a separate application. The synchronisation / indexing is done using a pull-approach and triggered by a schedueld process in SOLR. For that very reason, there will always be asynchronocity between updates to the DB and the state that can be searched via SOLR.
Furthermore, a "property cache" has nothing to do with performing searches. The property cache on the Repository tier is only used to re-use already loaded property values to avoid costly DB round-trips when the same node is read multiple times without changes between those reads. SOLR indexing is independent of that cache as it always gets its data from the database, circumventing the cache to ensure it does not get stale data or flood the cache, thereby purging any data the users are currently using from the cache.
Alfresco has introduced transactional metadata query support in Alfresco 4.2, which was further enhanced in Alfresco 5.1. With that, you can write Alfresco FTS queries that can be executed against the database, and don't have to wait for any asynchronous update process, as long as your query conforms with some requirements (exact-match oriented conditions, no use of index-only query fields...).
That feature also does not use any property cache to perform the search operation. Nothing needs to be forced. As soon as the data has been updated on the DB, it can be queried.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.