Expand my Community achievements bar.

Search with 'boost' factor

Avatar

Level 4

I have a search requirement where template A pages should appear before template B pages.

Is it possible to achieve with 'Lucene 'boost' configuration ? Please let me know if somebody has implemented similar usecase.

3 Replies

Avatar

Level 9

Hi,

Just providing details on whatever I am aware of :

Have seen instances wherein SQL2 query string with runtime lucene boosting is used at field level. 

Snippet as below :

StringBuilder query = new StringBuilder();

query.append("SELECT Path FROM [nt:base] AS s WHERE ISDESCENDANTNODE();

query.append(" AND ");
        query.append("(");

 query.append("CONTAINS(s.[cq:tags],'" + searchterm + "^600')");
        query.append(" OR ");

and so on..

Avatar

Level 4

Thanks for your reply.Was looking for more on configuration level in AEM repository.

Avatar

Level 10

I would recommend reading this here: 

https://blog.imaginea.com/understanding-lucene-boosting-part-1/

I am not aware of any AEM specific content for this use case. But the above blog would be a good place to start.