Foros de discusión

Creating facet based on layout uuid

Valentin BECK, modificado hace 7 años.

Creating facet based on layout uuid

New Member Mensajes: 8 Fecha de incorporación: 8/08/14 Mensajes recientes
Hi all,

I need to create a facet based on the layout of the document.

For exemple, if I create a web content on the page "Test", I need to retrieve a facet with the layout "Test" and when i click on this facet, I get my web content.

When we add a web content on a page, a keyword is added like that (JournalArticleIndexer.java) :

document.addKeyword(Field.LAYOUT_UUID, article.getLayoutUuid());

But, in the index, this layout is never used and it's not appear on the index of Solr (or Lucene).

Is it possible to do that? And how?

Thank you in advance.

Best regards,
Valentin
thumbnail
Amos Fong, modificado hace 7 años.

RE: Creating facet based on layout uuid

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
Hi Valentin,

I think this field is not what you think it is. There used to be a type of Layout called web content (https://issues.liferay.com/browse/LPS-19760), I believe that's what that field was used for.

I don't think the layouts the web content is added on is currently added to the index. You could do it with some customization though.

1. Create a PostIndexProcessor (https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/extending-the-indexer-post-processor-using-a-hook)
2. Add the info you want yourself. Take a look at JournalOpenSearchImpl to see an example of how to find out which Layouts a web content is on.

HTH