cancel
Showing results for 
Search instead for 
Did you mean: 

searching a document based on the content of the file.

inderjeet_kalra
Champ in-the-making
Champ in-the-making
Hi all,
another issue related to the search mechanism provided by alfresco….
I have used FileFolderService to search on a particular node reference in the hierarcy and i get the exact results but all the search methods in this service takes the name of the file….
how can i customize it to search on content i.e. text in side the file which we can do through lucene by writing name:, text: attributes….
Please tell me any way around to search a file on a particular node and on name, text etc attributes……

Thanks in advance….

Regards
Inderjeet
5 REPLIES 5

kevinr
Star Contributor
Star Contributor
You may be better using the SearchService directly and creating a lucene search - this is much more flexible and you can search against any attribute, aspect, type, noderef etc.
http://wiki.alfresco.com/wiki/Search

Thanks,

Kevin

inderjeet_kalra
Champ in-the-making
Champ in-the-making
Thanks for your response…

I tried that option but unable to make a lucene query for a searching on a particular node….i faced problem in the PATH query where i can specify the path of the node reference where i need to search…..
I have posted my concern , plz read the following and suggest me what to do…


http://forums.alfresco.com/viewtopic.php?t=3837

kevinr
Star Contributor
Star Contributor
A good way to learn how to build valid lucene searches for searching folders, paths, text etc. is to look at how the web-client builds searches in the UI.

If you enable the following debug flag in your log4j.properties:

log4j.logger.org.alfresco.web.bean.SearchContext=debug

then when you use simple search or the Advanced Search screen in the client, the console will output the generated Lucene query, play around with the various settings in Advanced Search to see what's generated.

Hope this helps,

Kevin

inderjeet_kalra
Champ in-the-making
Champ in-the-making
Thanks kevin,
i will try this also but can you provide me any documentation for the PATH query because i am not getting the expected reult after providing the node path…

Thanks once again

inderjeet

kevinr
Star Contributor
Star Contributor
http://wiki.alfresco.com/wiki/Search#Path_Queries

Note that the  ISO9075 encoded association QName is used for the path elements - you can use the org.alfresco.util.ISO9075 utility class to encode you qname path elements.

Thanks,

Kevin