Is there any way to use fulltext for equal operator rather than contains? | Community
Skip to main content
New Participant
September 27, 2018
Solved

Is there any way to use fulltext for equal operator rather than contains?

  • September 27, 2018
  • 5 replies
  • 2317 views

I have an requirement where i need to search for a string under a path for equal operation rather than contains?

For eg. I want to search all nodes having string Pankaj under /content/Site. And, there are two nodes:

1. /content/Site/Node1 having a property whose value is Pankaj

2. /content/Site/Node2 having a property whose value is PankajGirtotra

So output should be /content/Site/Node1 only.

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

Hello pankajg1611582

The following query structure should work for you

select * from [cq:PageContent] as s where isdescendantnode([/content/we-retail]) AND s.[*] = "Pankaj"

Best Regards,

Aneet Arora

5 replies

New Participant
September 27, 2018

Thanks, it worked.

aneetaroraAccepted solution
Employee
September 27, 2018

Hello pankajg1611582

The following query structure should work for you

select * from [cq:PageContent] as s where isdescendantnode([/content/we-retail]) AND s.[*] = "Pankaj"

Best Regards,

Aneet Arora

arunpatidar
New Participant
September 27, 2018

QueryBuilder Debugger - http://localhost:4502/libs/cq/search/content/querydebug.html

path=/content/Site

fulltext=Pankaj

p.limit=-1

Arun Patidar
New Participant
September 27, 2018

Here you are searching for specific property. And my Issue is, i don't know the property on which that value could present. It could be present on any property. So, its like fulltext but with equal operation.

arunpatidar
New Participant
September 27, 2018

Yes, You can do it:

QueryBuilder Debugger - http://localhost:4502/libs/cq/search/content/querydebug.html

path=/content/Site

property=propertyName

property.value=Pankaj

p.limit=-1

SQL2

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE(s,'/content/Site') AND s.[propertyName] = 'Pankaj'

XPATH

/jcr:root/content/Site//*

[

(@propertyName = 'Pankaj')

]

Arun Patidar