jcr-sql2 query starting with specific string | Community
Skip to main content
Level 3
January 17, 2018

jcr-sql2 query starting with specific string

  • January 17, 2018
  • 2 replies
  • 7357 views

Hello Team,

In the jcr-sql2 query, is there any way to query the property having the value starts with certain string. 

I have overlapping tags, business:Finance, business:Insurance and global_search_business:Finance, global_search_business:Insurance. I want to only query the content tagged with all business: tags(but not global_search_business: tags).

SELECT * FROM [cq:PageContent] as node WHERE ISDESCENDANTNODE(node, '/content/geometrixx/en/news') AND CONTAINS([cq:tags], "business:") returning the content tagged with both.

I tried CONTAINS([cq:tags], "^business:"), its giving syntax error.

Even I tried LIKE, but no success.

Any suggestions please?

Best Regards,

Durga

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

edubey
Level 10
January 17, 2018

Can you share the query where you used like clause ?

Level 5
January 17, 2018

Can you add one more condition: and not CONTAINS([cq:tags], "global_search_business")

smacdonald2008
Level 10
January 17, 2018

Here is a good source of JCR SQL2 examples that may help you.

JCR Query Cheat Sheet - Community Wiki - Magnolia

Hope this helps...