Query Builder example to pass the options in query | Community
Skip to main content
zankarshah
June 4, 2024
Solved

Query Builder example to pass the options in query

  • June 4, 2024
  • 4 replies
  • 1844 views

Hello! 

I have used tags as part of my index so that I can query specific to index

jcr:mixinTypes="[rep:AccessControllable]"
    jcr:primaryType="oak:QueryIndexDefinition"
    async="[async,nrt]"
    compatVersion="{Long}2"
    evaluatePathRestrictions="{Boolean}true"
    excludedPaths="[/var,/etc/replication,/etc/workflow/instances,/jcr:system]"
    includedPaths="[/content/data]"
    queryPaths="[/content/data]"
    reindex="{Boolean}false"
    reindexCount="{Long}1"
    seed="{Long}-4788584413483415353"
    type="lucene"
    tags="[customSearch]">
 
Now XPath query is working all good 
/jcr:root/content/data/element(*, cq:Page)[(jcr:contains(., 'venue'))] option (index tag customSearch)
 
How to use the same option using Query Builder ?

fulltext=venue
type=cq:Page
path=/content/data
p.limit=10

 

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 SandeepTamiri

Hi @zankarshah 

You can try using the below in Query builder

 

fulltext=venue
type=cq:Page
path=/content/data
p.limit=10

p.indexTag=customSearch

 

p.indexTag - if set will include an index tag option in the query, It is mentioned in the documentation[0]

 

Thanks,

Sandeep

[0]: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/full-stack/search/query-builder-predicates

4 replies

Keerthi0555
June 4, 2024

Hi,

Please elaborate you are query.

You are trying to fing pages with tags or finding pages with full text?

zankarshah
June 4, 2024

My main question is how to use the OPTION in Query Builder Debugger tool
In XPATH I can search results with OPTION as follow

/jcr:root/content/data/element(*, cq:Page)[(jcr:contains(., 'venue'))] option (index tag customSearch)

 

What is the equivalent way to do via Query Builder Debugger ?

 

Thanks,

Zankar

arunpatidar
Community Advisor
Community Advisor
June 4, 2024

Hi @zankarshah 
You can try below from CRX query, I am not sure if it is possible to use OPTION with querybuilder debugger.

Note each index can have multiple tags, and the same tag can be used in multiple indexes. The syntax to limit a query to a certain tag is: <query> option(index tag <tagName>):

XPATH

/jcr:root/content//element(*, nt:file)[jcr:contains(., 'test')] option(index tag x)

 

SQL

select * from [nt:file] where ischildnode('/content') and contains(*, 'test') option(index tag [x])

Arun Patidar
sateaswa94
Level 3
August 27, 2024

Hi @zankarshah , I am working on a similar issue, let me know if you found a workaround to fix it

zankarshah
August 27, 2024

hi @sateaswa94 

I was not able to use Option in query builder.  Luckily all my nodes were having certain property which I could use easily to identify 

Thanks!

Zankar

SandeepTamiri
Adobe Employee
SandeepTamiriAdobe EmployeeAccepted solution
Adobe Employee
October 23, 2024

Hi @zankarshah 

You can try using the below in Query builder

 

fulltext=venue
type=cq:Page
path=/content/data
p.limit=10

p.indexTag=customSearch

 

p.indexTag - if set will include an index tag option in the query, It is mentioned in the documentation[0]

 

Thanks,

Sandeep

[0]: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/full-stack/search/query-builder-predicates

sateaswa94
Level 3
October 23, 2024

This should be the accepted solution. Thanks sandeep