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
  • 4690 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

Level 2
October 16, 2015

I understand that if more than one component has keyword than I need to choose the page. But my question is more on how? what is the code syntax to  get only the page name from the URL and skip other URLS in the resultset?

Your help is really appreciated.

 

thanks

gcarlino
Adobe Employee
Adobe Employee
October 16, 2015

I don't know how to do that. As Bsloki said, I doubt if you have that option in Querybuilder. I was just trying to help you with a workaround.