cancel
Showing results for 
Search instead for 
Did you mean: 

after moving a document. a opencmis query doesn't find it

iruizdeeguilaz
Champ in-the-making
Champ in-the-making
Hello

the problem is that if I move a document (cut and paste) on the Alfresco Explorer into other folder, when I try to look for it on opencmis (a session.query), it isn´t able to find it , but if I move again the document into the previous place (the place it was upload), it is able to find it. so the query is correct, but I wouuld like to know if I need to refresh something in order to find it.


results = session.query("SELECT * FROM my:document as t join my:documentAspect as d on d.cmis:objectId = t.cmis:objectId where d.my:idDoc=xxxxx ", false);
….


why could this happen???

thaks so much
4 REPLIES 4

kaynezhang
World-Class Innovator
World-Class Innovator
Where did you move the document to? I guess maybe you moved it out of cmis root folder.
No matter where you move to make sure it is still under company home folder.

yes it is under company home space always

the main problem was that i did a migration to this path : companyhome/myproject
but after that I had to change to companyhome/companyname/myproject  So I created a space called companyname under company home and I moved the folder using Alfresco Explorer instead of migrating again with opencmis.

in other example I uploaded a new document from opencmis code in companyhome/companyname/myproject/year/month/day (I could find this document by query)
I moved it to companyhome/companyname/myproject/year/month in order to see if it was the problem… and then I couldn't find it…. after a while I moved it again to companyhome/companyname/myproject/year/month/day and the queary worked again.

but I can´t see all documents migrated , they are a lot and I need  to know if it is possible maybe to refresh lucene or something like that. I don't understand why this happen.

in adittion to this if a look for the document by path or by id I cand find it


  Document prueba = (Document) session.getObjectByPath("/companyname/myproject/2013/3/3/image.jpg");
          System.out.println( prueba.getName());
          System.out.println(  prueba.getPropertyValue("my:idDocument"));

but it I can´t find it using session.query where myproperty = '' after moving it

I have other question here, perhaps it is possible to look for a objtect instead by path by a property (it could solve my problem)

thanks so much

jpotts
World-Class Innovator
World-Class Innovator
Use session.getObject(CMIS_OBJECT_ID) to find the object.

It could be that your index is corrupt or hasn't caught up yet, particularly if you did a big move.

Jeff

<blockquote>
It could be that your index is corrupt
</blockquote>

it was. I did a reindesex and right now I am be able to find it (At least a little query tests I have made)

I have followed the ensuing steps:

to set index.recovery.mode=FULL in the alfresco-global properties, stop the Alfresco Repository, zap the index directory, and start the repo again.

probably when I was testing the possility of tenants and I changed a lot of things, even the custom model and so on. It became courrupt

thaks so much