How to exclude certain properties from fulltext search | Community
Skip to main content
vasimakram
Level 4
September 8, 2022

How to exclude certain properties from fulltext search

  • September 8, 2022
  • 3 replies
  • 1306 views

I am using following query for fulltext search

 

type=cq:Page

path=/content/we-retail/en

fulltext=cricket

 

It is getting certain results which are not needed in the results. Is there a way to restrict the results.

 

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.

3 replies

ksh_ingole7
Community Advisor
Community Advisor
September 8, 2022

Hey @vasimakram 

 

You can use : 

 

  • property.operation - The operation you want to perform for the test. The available operations are equals, unequals, like, not, exists.

For example :

 

type=cq:Page

path=/content/we-retail/en

fulltext=cricket

property=formatODI

property.operation=not

 

Please let me know in case of any further assistance.

 

Thanks

 

 

vasimakram
Level 4
September 8, 2022

property.operation = not will be used to check if property value is not equal to some value. It will not work for fulltext

vasimakram
Level 4
September 15, 2022

Hey @vasimakram 

 

I tried with exists and not and it worked perfectly fine. 

 

Query 1 : 

Shows all pages having keyword- 'car' and where editOption property exists

 

Query 2 :

 

Shows all pages having keyword- 'car' and where editOption property does not exist

 

Please let me know in case of further queries

 

 


This will work for property search. Not for full text search.

When I do fulltext search I am getting pages where this text is available. In one of the page I have used banner component. This component have one background image.

like

HTML:
<img src="/content/dam/wknd/cricket-stadium.jpg">
<div>..........</div>
</img>
HTL:
<img src="${properties.bgImg}">
<div></div>
</img>


In this case the image path has my fulltext keyword. I wan't to ignore bgImg property from the results 

Anmol_Bhardwaj
Community Advisor
Community Advisor
September 8, 2022

Can you briefly explain your use case/requirement @vasimakram ? It'll make it easier to get to a solution.

Level 4
September 14, 2022

Hi @vasimakram ,

 

You can also add a page property like a check box to hide in search. If that checkbox is enabled on the page then it will not show up in search results.

Modify the query to check for the property

 

type=cq:Page

path=/content/we-retail/en

fulltext=cricket

boolproperty=@jcr:content/hideInSearch

boolproperty.value=false

 

Hope this helps.