Is there any way to use fulltext for equal operator rather than contains? | Community
Skip to main content
Level 2
Sep 27, 2018 3:41 PM UTC
Solved

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

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.
aneetaroraAccepted solution
Employee
Sep 27, 2018 5:52 PM UTC

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

Level 2
Sep 27, 2018 8:58 PM UTC

Thanks, it worked.

Translate
aneetaroraAccepted solution
Employee
Sep 27, 2018 5:52 PM UTC

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

Translate
arunpatidar
New Participant
Sep 27, 2018 5:46 PM UTC

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

path=/content/Site

fulltext=Pankaj

p.limit=-1

Translate
Arun Patidar
Level 2
Sep 27, 2018 5:30 PM UTC

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.

Translate
arunpatidar
New Participant
Sep 27, 2018 5:10 PM UTC

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')

]

Translate
Arun Patidar