Chuyển đến nội dung chính

[Query Builder] Advanced Search

Using the Advanced Search

When using a list, select from the 'Build list using' options 'Advanced Search.' This will open a new tab in the list window with one text box labeled: 'Querybuilder Predicate Notation.' This is asking for a few lines of code to define search parameters.

Example Code - With Explanations of Results

Searching for Pages



type=cq:Page
property=jcr:content/jcr:title
property.value=Places
  • 'type' defines what sort of object you'll be searching for (it's usually a page).
  • 'property' defines what property of the object you'll be filtering by; in this case, its by the title.
  • 'property.value' defines your search term.
So this search would be searching all PAGES with the TITLE of PLACES.
So it would find every page titled Places.
*IMPORTANT* Searches by title ARE case-sensitive, so 'Places' is not the same as 'places'.



type=cq:Page
path=/cq/sandbox
property=jcr:content/jcr:title
property.operation=like
property.value=Sub%
By including 'property.operation=like' and using the '%' wildcard, multiple pages with similar titles can be pulled by the same search.
A wildcard is a character that the program reads as able to stand in for any character in any number (e.g. 'stair%' would get pages named 'stair', 'stairs', and even 'stair case'; and '%stair%' could get a page like 'upstairs', or 'get upstairs').
*REMEMBER* Titles are case-sensitive, but wildcards will search for both cases.



type=cq:Page
property=jcr:content/cq:template
property.value=/apps/odu/templates/places
Similarly, this search would be searching all PAGES with the TEMPLATE located at /APPS/ODU/TEMPLATES/PLACES.
So it would find every page made with the Places template.



type=cq:Page
property=jcr:content/par/section/listpages/listFrom
 property.value=querybuilder
By viewing the .5.json information of a page, you can narrow down to almost any page property you want to search by. For example, this search would find every Page that has an advanced search component that is contained in a 'section' component.
In the /adv-search.5.json page, you can see the path to each component, reading like an outline.
If it appears as a continuous line of text, download a json viewer. A good choice for firefox users is: http://jsonview.com/



type=cq:Page
tagid=org:acadaffairs/acadenhancement
tagid.property=jcr:content/cq:tags
path=
path.exact=true
By using 'tagid', you can search by tags (just make sure you're using the full tag), just set the 'tagid' to your desired tag, and set 'tagid.property' to 'jcr:content/cq:tags', which is where the search program will find the tags.
More on the 'path' feature, by including 'path.exact=true' it limits the scope of the search to only that level, not the child directories, meaning it will only search the pages under '' and not, for example, pages under '/elt'. In this case, it lets you find all pages tagged with 'org:acadaffairs/acadenhancement' under '' and didn't pull any of the child pages of the pages it found.



type=cq:Page
fulltext=monarch
path=/cq/sandbox
You can even search for pages that have certain text on them by using 'fulltext' to define your search. 'Fulltext' searches not just the words on the page, but also for object titles (like images).
In cases like this, and others, it would be good to limit the scope of your search so it won't try searching every page on the site for a string of words. do this by using 'path' to define your search area.
This essentially is checking if a page has the text you're looking for AND is under the defined path.



type=cq:Page
fulltext=monarch
group.p.or=true
group.1_path=/cq/sandbox
group.2_path=/about
If you want to search under multiple paths, include the line 'group.p.or=true'; it tells the search that the search parameters under 'group' are OR statements. In that, it will be checking if a page has the text you're looking for AND is under path 1 OR 2.
For those who like boolean statements, it's easy to consider it like this:
(fulltext=monarch) AND (path=1_path OR path=2_path)



type=cq:Page
path=/cq/sandbox
group.p.or=false
group.1_fulltext=monarch
group.2_fulltext=college
If you want to narrow your search by using two text searches, include the line 'group.p.or=false'; it tells the search that the search parameters under 'group' are AND statements. In that, it will be checking if a page under the given path AND contains text1 AND text2.
For those who like boolean statements, it's easy to consider it like this:
(path=path) AND (fulltext=text1 AND fulltext=text2)

Searching for Assets



type=cq:Page
tagid=org:acadaffairs/acadenhancement
tagid.property=jcr:content/cq:tags
path=
path.exact=true
group.p.not=true
group.path=/academicenhancement
group.path.self=true
If you want to narrow your search by excluding a certain path or other search parameter, make a group and use the line 'group.p.not=true', it tells the search that the group will be treated as a 'not' statement. Be sure to include 'group.path.self=true', it tells the search to look in the base node.



type=dam:Asset
path=/content/dam/odu/col-dept/teacher-education-services/docs
nodename=*.doc
When searching for assets, use 'type=dam:Asset' and make sure that the path (if used) is pointing to somewhere in the dam.
Defining 'nodename' limits the search to files with the given file extension (eg .pdf .jpg .jpeg .docx .ppt).



type=dam:Asset
path=/content/dam/odu/col-dept/teacher-education-services/docs
property=jcr:content/metadata/dc:title
property.1_value=Entry Assessment into Virginia Approved Programs - Revised April 2010
property.2_value=Statement of Acknowledgement
By including 'property=jcr:content/metadata/dc:title' you can search by title. To search for more than one title use 'property.1_value=title1' and so on for as many titles as needed, otherwise, you can just use 'property.value=title'.



type=dam:Asset
path=/content/dam/odu/col-dept/teacher-education-services/docs
property=jcr:content/metadata/dc:title
property.operation=like
property.value=%2011%
By including 'property.operation=like' and using the '%' wildcard, multiple assets with similar titles can be pulled by the same search.
A wildcard is a character that the program reads as able to stand in for any character in any number (e.g. 'stair%' would get assets named 'stair', 'stairs', and even 'stair case'; and '%stair%' could get an asset like 'upstairs', or 'get upstairs').
*REMEMBER* Titles are case-sensitive, but wildcards will search for both cases.



type=dam:Asset
path=/content/dam/odu/col-dept/teacher-education-services/docs
group.p.and=true
group.1_property=jcr:content/metadata/dc:title
 group.1_property.value=%Post%
group.1_property.operation=like
group.2_property=jcr:content/metadata/dc:title
group.2_property.value=%2011%
group.2_property.operation=like
By making use of groups, you can search for titles that fulfil multiple requirements. The search on the right will find all documents under the given path that include 'Post" AND '2011' somewhere in the title.



type=dam:Asset
path= /content/dam/odu/news/insideodu/2014/02/27
 nodename= feature2-lg*.jpg
Returns all files that begin with 'feature2-lg' and end with '.jpg' in the /content/dam/odu/news/inside/odu/2014/02/27 folder.

This would be useful in creating rules for galleries that would be calling on similarly named images.
'nodename' seems to refer to the actual filename, as opposed to the asset title.



path=/var/audit/com.day.cq.replication/content/cag
group.p.or=false
group.1_property=cq:type
group.1_property.value=Activate
group.2_property=cq:path
group.2_property.value=/content/cag/en/airport-experience/attractions-and-services/movie-theatre
group.3_relativedaterange.property=cq:time
group.3_relativedaterange.lowerBound=-1d
p.limit=-1

Search activated event of the page in the period of time















Ref:
https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/querybuilder-predicate-reference.html

Nhận xét

Bài đăng phổ biến từ blog này

How to add a new supported language in CQ / WEM (Translator in CQ)

Use case:  You want to add new language to CQ Change display language options in translator grid Change language name and default countries  Solution: You can access translator UI in CQ with following URL http://<HOST>:<PORT>/libs/cq/i18n/translator.html Create new language location for Dictionary Go to CRXDE lite (or your favorite JCR browser) and add this structure (assuming /apps/myapp/i18n as a typical location for custom apps): /apps/myapp/i18n [sling:Folder]     - de [nt:unstructured]         + jcr:mixinTypes = [mix:language]         + jcr:language = de     - fr [nt:unstructured]         + jcr:mixinTypes = [mix:language]         + jcr:language = fr Then reload the translator and the path /apps/ myapp /i18n should show up in the drop-down at the top. Note: the translator will only save translations for languages that are actually present underneath the path (e.g. /apps/myapp/i18n), others will be skipped. Then on jsp pa

Login / Logout on a Publish instance and Closed User Group (CUG)

In CQ5 there is the login logout could be configured using a Closed User Group. Closed User Groups (CUGs) are used to limit access to specific pages that reside within a published internet site. Such pages require the assigned members to login and provide security credentials. http://dev.day.com/docs/en/cq/5-4/howto/create_apply_cug.html The logout using /libs/cq/core/content/login.logout.html always gets redirected to the geometrixx site   http://localhost:4503/content/geometrixx-outdoors/en.html By configuring the Default login page  under the osgi configuration for com.day.cq.auth.impl.LoginSelectorHandler to be – /content/mysite/en/login But still after logout the page goes to the geometrixx site. IIRC, the redirect first goes to to / which then goes through the standard, somewhat complex handling of the root with multiple redirects: 1) / has a resource type of sling:redirect and redirects to /index.html 2) /index.html is handled by the RootMappingServlet [0] which h

[PERFORMANCE] Adobe WEM/CQ performance tuning

Adobe WEM/CQ performance tuning Contents Caching-related configurations CRX Bundle cache CRX Search index handler (Lucene) cache Tar PM index cache Scalability Maintenance Optimizing Tar Files (for Tar Persistence Manager) Data Store Garbage Collection Main documentation you should consult first: http://dev.day.com/docs/en/cq/current/deploying/performance.html http://dev.day.com/content/kb/home/cq5/CQ5Troubleshooting/performancetuningtips.html Caching-related configurations CRX Bundle cache CRX caches bundles, consisting of a node with all its properties. This is used by all bundle-based Persistence Managers. The default size of BundleCache is 8 MB. If this is too small it can cause an excessive number of read-accesses to the underlying persistence layer. Set the bundleCacheSize to something larger than the default. See more here: http://dev.day.com/docs/en/cq/current/deploying/performance.html#CRX%20Bundle%20Cache CRX Search index handler (Lucene