cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene serching issue.

greglenain
Champ in-the-making
Champ in-the-making
he language Lucene query language doesn't always make it possible to find the awaited objects.

The following query returns the list of all the documents or directories contained in "myDirectoryName":

PATH:"app:company_home/cm:myDirectoryName/cm:*"

When the name of the repertory "myDirectoryName" is changed into "myNewDirectoryName", the query should be modified in:

PATH:"app:company_home/cm:myNewDirectoryName/cm:*"

This query however does not return any result!
And the old one continues to work.


In first analysis, it seems that the attribute "qname" of the table "child_assoc" is not updated after the name of "myDirectoryName" was changed.

How to allow Lucene to deal with the objects real name?
3 REPLIES 3

andy
Champ on-the-rise
Champ on-the-rise
Hi

There are two things here.
1) The name property of a node
2) The Qname of the association to that node

If you change the name property it does not change the name of the association to the node. PATH uses the qname of the association.
To change the name of an association you would have to do a move of the node.

If name and qname are used as the same thing they need to be kept in sync.

There is active work on a FileFolderService, which will do some of this work for you. This is likely to be the nightly build in the next few days.

There is a Jira task for this (AR-236) if you want to track progress.

The web client does not keep these two in sync at all times at the moment. But it I am told it will soon.

Regards

Andy

greglenain
Champ in-the-making
Champ in-the-making
Do you mean the task AR-236 is about the node.name and assoc.qname sync?

If so, what will be the FileFolderService general purposes?

Thanks.

derek
Star Contributor
Star Contributor
Hi,

The FileFolderService (org.alfresco.repo.model.filefolder.FileFolderServiceImpl.java) allows browsing of files and folders specifically, ignoring system folders.

If you look at the XPath statements, you will see that the browsing and searching is done by the cm:name property.  This removes the dependency on having the association QName in sync with the name.  It's a convenience to have them aligned, but really the cm:name drives the model.

The FileFolderService is a convenience to abstract away all the nitty gritty for those developers who want to focus on a File/Folder-based model, which is probably most.  Just about all the Alfresco client code has been made to use this service, so the association names should be staying in sync with the names.

Regards