cancel
Showing results for 
Search instead for 
Did you mean: 

xpath Search

anshu_kumar
Star Contributor
Star Contributor
I am working on Enterprise v4.1.7. When I'm executing below piece of code in Repository scripts,
<!–break–>
var query = "/app:company_home/app:dictionary/app:email_templates/*[@cm:name='activities']";
if(search.isValidXpathQuery(query))
{
   var nodes = search.xpathSearch(query);
}


I am getting this error <em>Failed to run Actions due to error: 00313884 Failed to execute script 'workspace://SpacesStore/1d9b35dd-0519-4098-aaf7-92e0fffa095a': 00313883 Failed to execute search: /app:company_home/app:dictionary/app:email_templates/*[@cm:name='activities']</em>

And this is caused by <em>java.lang.UnsupportedOperationException</em>

This is even when it successfully validates <strong>'isValidXpathQuery'</strong> method.

I'm not sure what I've missed here. Can anybody help me with this?
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
I'm not sure why that is failing but is xpath a requirement? You can get the desired result by running the Lucene equivalent, which is:


+PATH:"/app:company_home/app:dictionary/app:email_templates/*" +@cm\:name:"activities"


Jeff

mrinal3199
Champ in-the-making
Champ in-the-making
Hi Jeff,

    Lucene does not support Exact search. Can you tell me, do XPath supports and How should be the query in the node browser say for a particuar property cm:title of a articuar type cm:content. Please do reply.

Thanks,
Mrinal

kaynezhang
World-Class Innovator
World-Class Innovator
It seems Xpath language does not support complex queries .I also use lucene language.