Force update node property cache lucene

cancel
Showing results for 
Search instead for 
Did you mean: 
sergeyklim
Member II

Force update node property cache lucene

Jump to solution

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

1 Solution

Accepted Solutions
afaust
Master

Re: Force update node property cache lucene

Jump 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.

View solution in original post

1 Reply
afaust
Master

Re: Force update node property cache lucene

Jump 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.