How to exclude a specific node path from fulltext search ? | Community
Skip to main content
touseefk2181136
Level 3
July 22, 2024
Solved

How to exclude a specific node path from fulltext search ?

  • July 22, 2024
  • 2 replies
  • 1249 views
I have created oak index. By creating it following query working fine in query builder
 
path=/content/data
type=nt:unstructured
fulltext=test
 
But it is getting text from all nodes like /content/data/stores, /content/data/offers, /content/data/promotions. I want to exclude this node /content/data/stores. How can I achieve this ? I tried following queries but it didn't work as expected.


path=/content/data
type=nt:unstructured
fulltext=test
1_path=/content/data/stores
1_path.operation=exclude

and 

path=/content/data
type=nt:unstructured
fulltext=test
group.p.or=true
group.1_path=-/content/data/stores

Thanks in advance.

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 anupampat

Hi @touseefk2181136 ,

 

try below :-

Reference - https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md

 

 

type=nt:unstructured fulltext=test group.1_group.p.not=true group.1_group.path=/content/data/stores group.1_group.path.self=true path=/content/data

 

2 replies

Jagadeesh_Prakash
Community Advisor
Community Advisor
July 22, 2024

@touseefk2181136  Below is an example in SQL2 

 

SELECT * FROM[nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, '/content/data')
AND NOT ISDESCENDANTNODE(node, '/content/data/stores')
AND CONTAINS(node.*, 'test')
 
touseefk2181136
Level 3
July 22, 2024

Thanks, I need to implement paging as well there I need this solution in query builder api.

anupampat
Community Advisor
anupampatCommunity AdvisorAccepted solution
Community Advisor
July 22, 2024

Hi @touseefk2181136 ,

 

try below :-

Reference - https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md

 

 

type=nt:unstructured fulltext=test group.1_group.p.not=true group.1_group.path=/content/data/stores group.1_group.path.self=true path=/content/data

 

touseefk2181136
Level 3
July 22, 2024

Thank you. This is exactly what I was looking for