Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to exclude a specific node path from fulltext search ?

Avatar

Level 3
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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Community Advisor

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

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

Avatar

Level 5

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