cancel
Showing results for 
Search instead for 
Did you mean: 

Search, stores and their purposes

calle
Champ in-the-making
Champ in-the-making
Hi
I am implementing a service that searches in old versions of content.

From what I have understood reading about the SearchService I should change the StoreRef being used in the SearchService.query(…) call. I use Alfresco 2.2 e. I have found several threads about this but none explains the problem fully.

To start, lets look at the different stores I know about:
  1. workspace://SpacesStore - the normal content store

  2. workspace://lightWeightVersionStore - should be the store for old versions?

  3. archive://SpacesStore - the trash

  4. system://system - system information
Also, I have read about versionStore://lightWeightVersionStore, versionstore://main, workspace://default and the new workspace://version2Store

My first thought was that I should use the workspace://lightWeightVersionStore when searching for old versions. However, specifying this store always results in 0 hits, whatever I search for. Neither  versionStore://lightWeightVersionStore gives any results. The search returns results when i use the workspace://SpacesStore or archive://SpacesStore, but not the old versions of course…

From what I have read in the forum I am not the first person trying to search in previous content versions. Anyone able to clarify the store definitions above?

One thought was that no indexes are created for old versions but when tracing the VersionService.createVersion() I am able to verify that the IndexerComponent is called. And it uses the workspace://lightWeightVersionStore for its nodes. Does this mean that old versions are stored here?

thanks
//Carl
2 REPLIES 2

calle
Champ in-the-making
Champ in-the-making
I have made some progress…
First, I believe that the Store to search in is workspace://lightWeightVersionStore. If I search for all objects (by query PATH:"/*") then I get the expected number of hits back. What I do not understand is what I am getting back Smiley Happy I can see it is of type {http://www.alfresco.org/model/versionstore/1.0}versionHistory and I get a bunch of properties for each node for example the node id of the versioned node in workspace://SpacesStore (VersionModel.PROP_QNAME_VERSIONED_NODE_ID).

Now I am able to get all the nodes in the lightWeightVersionStore and get a reference to the current version node. What I am still not able to do is search in the lightWeightVersionStore for old properties or in content without manually searching in the list of returned versionHistory objects. What I wonder is if only the properties in the versionstore model are being indexed for old versions which would make it impossible to search for properties or content in the old version.

rivarola
Champ on-the-rise
Champ on-the-rise
Hi,

I think you're right on all points. The lightweightVersionStore storage model is very specific. As each native property is mapped to a node in this store, a document in the workspace://SpacesStore will be mapped to several nodes here, and a composite Lucene search will not work because criteria would have to match on different nodes… Worse, the content is not indexed at all in the lightweightVersionStore !
Performing complex searches in this store will not be easy  :cry: