How to use QueryBuilder API to search a keyword a minimum of 2 times in the Page content. | Community
Skip to main content
Level 2
October 16, 2015
Solved

How to use QueryBuilder API to search a keyword a minimum of 2 times in the Page content.

  • October 16, 2015
  • 12 replies
  • 4709 views

QueryBuilder APi list all the pages  as a search results if it finds the keyword atleast once in the Search criteria in the Page content.

But if we need to search for twice occurance in the page content, How to get the keyword search result count to find how many times the keyword exist in the page content?

You help in this regard will be really appreciated.

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 gcarlino

I don't know whether this helps or not but if you do this query:

path=/your/path property=text property.operation=like property.value=%keyword% orderby:path p.limit=-1

You should see the list of components where the keyword appears ordered by path, which means that if you look at the list of results, you should see pages where the keyword appears in more than one component.

It would be bad luck if it appears twice in the same component, but you could do this to find that out:

path=/your/path property=text property.operation=like property.value=%keyword%keyword%

Hope that helps
 

12 replies

gcarlino
Adobe Employee
gcarlinoAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

I don't know whether this helps or not but if you do this query:

path=/your/path property=text property.operation=like property.value=%keyword% orderby:path p.limit=-1

You should see the list of components where the keyword appears ordered by path, which means that if you look at the list of results, you should see pages where the keyword appears in more than one component.

It would be bad luck if it appears twice in the same component, but you could do this to find that out:

path=/your/path property=text property.operation=like property.value=%keyword%keyword%

Hope that helps
 

Lokesh_Shivalingaiah
Level 10
October 16, 2015

I doubt if you have that option in Querybuilder (others can comment). but once you get the resultset from the querybuilder, you can use string operation and filter the result set