Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM Search

bilal_ahmad
Level 5
Level 5

Dear Members,

My search is fetching me relevant results but when I search for a specific page(by searching the exact page title) It shows it in the 11th position. I want to show it as my first result(if the search query matches the jcr:title or asset jcr:content/metadata/jcr:title).

Here is my xpath query :

(/jcr:root/content/mySite/sites/en-us//element(*, cq:Page)[(not(jcr:content/@isNotSearchable)) and (jcr:contains(., 'My Test Page'))] | /jcr:root/content/dam/mySite/en_us/domain//element(*, dam:Asset)[(jcr:content/metadata/@mySite:assetGated != 'yes') and (jcr:contains(., 'My Test Page'))])

I'm using AEM6.4.4.

Any input would be appreciated,

Many Thanks in Advance!

1 Accepted Solution
bilal_ahmad
Level 5
Level 5

Thank you so much, all for trying to help me. Apparently my segments were not proper and hence the indexes weren't getting created properly. After fixing that up, the boosting worked I was under the impression that if i'm doing a full-text search, boosting jcr:title doesn't work but that's not the case, it's working and the property is taking priority over other properties.

0 Replies
bilal_ahmad
Level 5
Level 5

Thanks a lot, Arun. Much appreciate your quick response. I have tried adding order by @jcr:title but it didn't work, shows the results in the same order

bilal_ahmad
Level 5
Level 5

Thanks a lot for the valuable suggestion. I have added boost property for jcr:title but the results appeared in the same order I

When I add a property/node in my custom index, then it takes a lot of time to re-index. Any suggestion to make the reindexing go any quicker ? Many Thanks in advance!

Jörg_Hoh
Employee
Employee

Out-of-band indexing is an admin task, which loads the system. That is not a task you want a random author to trigger if he wants to change some parameter of site search indexing (e.g. adding synonyms or boost a certain keyword).

rachanam1547401
Level 3
Level 3

Ok thanks!, I thought they want to make indexing faster and offloading it to somewhere else can make life easier so I replied for this question. "When I add a property/node in my custom index, then it takes a lot of time to re-index. Any suggestion to make the reindexing go any quicker ?"  - offloading won't make indexing faster but it's just makes primary usable and minimal or no downtime to apply index changes on prod!

bilal_ahmad
Level 5
Level 5

Ah! is this why my boosting didn't work ? cause my query has - (jcr:contains(., 'My Test Page'))

Use Boosts | Indexing time and query runtime

Note: The boost in this case is respected only if a jcr:contains() is done on the corresponding property, for example jcr:contains(@jcr:title, 'find this'). If there is only a jcr:contains(., 'find this'), the boosts at indexing time have no effect.

hamidk92094312
Employee
Employee

Can you verify if the same query written in SQL2 would output the results with proper ordering ? Is this isolated to XPATH ?

bilal_ahmad
Level 5
Level 5

Yes, Hamid. It's fetching the results in the same order even with SQL2 query

bilal_ahmad
Level 5
Level 5

This should be the 'must read' for any team before implementing the search for their application. thanks Jörg

bilal_ahmad
Level 5
Level 5

Thank you so much, all for trying to help me. Apparently my segments were not proper and hence the indexes weren't getting created properly. After fixing that up, the boosting worked I was under the impression that if i'm doing a full-text search, boosting jcr:title doesn't work but that's not the case, it's working and the property is taking priority over other properties.