cancel
Showing results for 
Search instead for 
Did you mean: 

XPath Search

deepusearching
Champ in-the-making
Champ in-the-making
Hi,

How can I search with the partial file name search. I can able to search with the full file name. I am using xpath as query language. The following is my query.

searchQuery = "/app:company_home/cm:mySpace//cm:*";
searchQuery = "/app:company_home/cm:mySpace//*";
searchQuery = "/app:company_home/cm:mySpace//cm:Invitation.doc";

The above three are working fine. How can I search the partial file name? I used:
searchQuery = "/app:company_home/cm:mySpace//cm:*nvitati*";

like this…

Please help me out.
Regards,
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
The XPath syntax is limited:
http://www.alfresco.org/mediawiki/index.php/Search_Documentation#Optimised_XPath_langauge

You are better off using the Lucene syntax:
http://www.alfresco.org/mediawiki/index.php/Search_Documentation#Lucene_Language

or maybe the fully-featured selectNodes() syntax (but this is much slower as it walks node hierarchies using the NodeService)

Thanks,

Kevin

rdanner
Champ in-the-making
Champ in-the-making
The XPath syntax is limited:
http://www.alfresco.org/mediawiki/index.php/Search_Documentation#Optimised_XPath_langauge

You are better off using the Lucene syntax:
http://www.alfresco.org/mediawiki/index.php/Search_Documentation#Lucene_Language

or maybe the fully-featured selectNodes() syntax (but this is much slower as it walks node hierarchies using the NodeService)

Thanks,

Kevin

Note: this wiki page is  great Smiley Happy