cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene query wrong behaviuor

abarisone
Star Contributor
Star Contributor
Hi all,
I'm experiencing a strange issue on Alfresco Community 4.0.d about Lucene PATH queries.
Say I have a node A (folder) that contains a node B (document): if I delete node B and after that I perform a Lucene PATH query using as path the path of node A, the system tells me that node A can't be found.
If I perform a full reindex the query is capable to find node A again.
The issue turns out randomly, and it never happens if I use Alfresco Web Client.

Is there something I could watch or debug, or is there something I could configure about indexing which is different from the basic configuration that comes out after installing Alfresco?

Thanks,
Andrea
6 REPLIES 6

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

This does sound odd.

Can you describe in more detail exactly what you need to do to reproduce this from a clean repository and what you installed etc
Who created everything, is this site/repository, exactly how did you run the search.
Are you sure you are using lucene (as the installer will give you SOLR) …. how did you confgure this ….

Andy

abarisone
Star Contributor
Star Contributor
Hi Andy,
I can confirm you that I'm using lucene, since in my alfresco-global.properties I set:
### Solr/Lucene indexing ###
index.subsystem.name=lucene
#dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443
I did not change any parameter in repository.properties, the repository come from a clean install.
I can also provide you with the code I use to perform the query
luceneQueryPath1 = "PATH:\""+path1+"\"";
var nodoValido = true;
var luceneSearchSudo = function() {
  var adminRisultatiNodo = search.luceneSearch(luceneQueryPath1);
  if (adminRisultatiNodo.length != 1)
         nodoValido = false;
};
and the content of variable luceneQueryPath1 taken from Alfresco debugger
PATH:"/app:company:home/cm:Uirnet/cm:Area_x0020_CRM/cm:_x0030_000/cm:_x0030_01/cm:_x0030_46/cm:CRM_AziendaA_0000001046/cm:Azienda/cm:_x0030_000/cm:_x0031_00"
After performing an upload and then deleting the child node, if I run the above code I get from the debugger:
adminRisultatiNodo.length = 0
It seems to happen when uploading and deleting the same file into the same space over and over again. From that point on the parent folder cannot be found.
I also managed to enable audit to take a picture of the situation, but I can't attach the file to the POST.

Thanks,
Andrea

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

Have you any rules that run when the file is added, updated or removed?
How do you add and remove this file?

The only thing that happens to the parent is the last modification time is updated.
You can switch this off, set

system.enableTimestampPropagation=false

Does this fix your issue?

Andy

abarisone
Star Contributor
Star Contributor
Hi Andy,
I don't have any rules running during the operation and I add/remmove files using webscripts code.
I modified the property as you told me but, unfortunately, it didn't solve my problem.
The test I performed is :
  • I uploaded a file
  • I deleted it
  • I uploaded the file again
  • I deleted the file again
Then when I try to upload the file for the third time, I cannot find the containg folder with a Lucene path query.

Any other idea?
Many thanks anyway.

Regards,
Andrea

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

Can you add your code so we know what is done exactly.

At the moment I do not see why the folder would be reindexed.

Is the parent a normal Folder?

If you repeat the query dose it come back with the answer (to make sure it is not timing out somewhere …on permissions evaluations for example)
How many nodes does your query match and how many of those can the user executing the query see?

Do you run your query to find the folder before you do anything and after each operation?
Can you confirim that the last modified timestamp for the parent has not moved on after you have run the test.

My best guess is that timestamps are being propagated in the version you have and in transaction part of the index update
has missed adding the parent for some reason.

Andy

abarisone
Star Contributor
Star Contributor
Hi,
Can you add your code so we know what is done exactly.
The upload code is quite long, I'm trying to build up a smaller version that performs the sequence of operations in order to reproduce the issue.
I will provide you the code as soon as I can. If you prefer to take a look to the whole code, tell me whether I have to insert it into the post between code tags or put on something like https://www.wetransfer.com/
Is the parent a normal Folder?
The parent folder is a cm:folder
If you repeat the query dose it come back with the answer (to make sure it is not timing out somewhere …on permissions evaluations for example)
The query always returns a result without any timeout
How many nodes does your query match and how many of those can the user executing the query see?
The query must always find just one node (folder)
Do you run your query to find the folder before you do anything and after each operation?
The query is performed before file uploading to assert the presence of the folder
Can you confirim that the last modified timestamp for the parent has not moved on after you have run the test.
I'm currently under a milestone release, I will tell you about this as soon as I can

Thanls a lot.
Regards,
Andrea