cancel
Showing results for 
Search instead for 
Did you mean: 

Searching a file in repository

itsard
Champ in-the-making
Champ in-the-making
Hi,
Can u help me with this…
I need to search a document in Alfresco repository.
I pass the file name and need to get the reference to it.
Below is the code am using.
Query query1 =new Query(Constants.QUERY_LANG_LUCENE,"PATH:\"/app:company_home/cm:sample_folder/cm:"+ISO9075.encode(lStringFileName)+"\"");

Whether I use the ISO9075.encode or not it gives random result.Sometimes it finds the doc and sometime doesnt. There is some prob with the documents having "_,digits,spaces" in their names.
Can u let me know the code for searching a document in the repository.
Alfresco version : 3.0 community edition

Thanks.
21 REPLIES 21

cheffilet
Champ in-the-making
Champ in-the-making
What I wish is I just provide the folder uuid in the query and it does the content search for all the docs in the below hierarchy.
I think you´re looking for something like this:

query.setStatement("PARENT: \"" this.store.getScheme()+ "://"+ store.getAddress() + "/"+ uuid+ "\" AND "
"TYPE:\\{http\\://www.alfresco.org/model/content/1.0\\}content ");

itsard
Champ in-the-making
Champ in-the-making
Hi,
I am trying this query but its not fetching me any record.
Can u give me the node browser query whose input is a uuid of a folder in spacesstore and a text to be searched.

I tried something like :
PARENT: "workspace://SpacesStore/cbb81351-4e7b-49cd-85c3-9dd423fdad2c" AND "TYPE:\{http\://www.alfresco.org/model/content/1.0\}content" TEXT:"bb"
I do have files with the content bb in the folders in the hierarchy below.
Thanks for your reply.

cheffilet
Champ in-the-making
Champ in-the-making
Can u give me the node browser query whose input is a uuid of a folder in spacesstore and a text to be searched.

PARENT: "workspace://SpacesStore/ec002e32-f392-4ea1-967e-7e6009d74c7f" AND TYPE:"{http://www.alfresco.org/model/content/1.0}content" AND TEXT:"bb"

itsard
Champ in-the-making
Champ in-the-making
Hi,


PARENT: "workspace://SpacesStore/2fc87f4b-a13f-4c3c-ad26-bbaced8c4819"  AND TEXT:"content*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}content"
This query does find the text in the folder specified by uuid. But it does not search in the hierarchy of folders under it.It just searches in one level.
"workspace://SpacesStore/2fc87f4b-a13f-4c3c-ad26-bbaced8c4819/*" and "workspace://SpacesStore/2fc87f4b-a13f-4c3c-ad26-bbaced8c4819//*"
also dont work.
Can you help me with that query?
Thanks.

cheffilet
Champ in-the-making
Champ in-the-making
I dont know wheter this is possible at all. Because you need an recursivly method for that to relolve all children that belongs to "one root node-uuid".

itsard
Champ in-the-making
Champ in-the-making
So can you kindly suggest me any other way to achieve the above requirement except using

PATH:"/app:company_home/cm:sample_folder/cm:Sample_Testing//*" AND TEXT:select*
Because for this query I would need to get all the folders in the hierarchy to create the path first and that would become clumsy.
Isnt there any other way?
Thanks again.

cheffilet
Champ in-the-making
Champ in-the-making
Its a realy bad idea to build up a whole tree with one request. Instead of this, you should take use a more asynchronous-approach on retrieving partialy folders/documents.

But, if you need to get all folders under a specific path, use following path:


PATH:"//app:company_home//*" AND +TYPE:"{http://www.alfresco.org/model/content/1.0}folder"

itsard
Champ in-the-making
Champ in-the-making
Hi,
Is there a way to find out a text inside the documents whose list i provide to the query.
For eg. if I have to search in 10 documents that are  in different folder hierarchies and not under the same parent, how would I achieve it ?
Something like I pass the collection of those 10 documents and the text content to be searched and I get the output as those documents in which the text is found.
Kindly do let me know as this is a major issue for my system
Thanks & Regards,

itsard
Champ in-the-making
Champ in-the-making
Can anyone help me out with this??

shamabbas
Champ in-the-making
Champ in-the-making
Hi all,
I wrote java code using web services client to upload and download files into and from alfresco repository. Uploading successfully working and so download is. Download has a lil issue hopefully il resolve it soon.
BUT i wanted to ask that the path
http://localhost:8080/alfresco/service/sample/folder/Company%20Home  where our uploaded file get stores if we want to retrieve them and

if move cursor to file it shows the following URL http://localhost:8080/alfresco/service/api/node/content/workspace/SpacesStore/d2edd2fa-b576-4a09-b46... hence by clicking we can download it.

Is there any method so i can access directly this URL   "http://localhost:8080/alfresco/service/api/node/content/workspace/SpacesStore/"  ,  index i know how to call il do so and then file name too but the URL is being used before these two things can i use it dynamically? Calling any function??? or ANYHOW????

Please help as soon as possible.. ill be very thankful to you guys!!!!

Sham