XWiki Search Issue: Included Page Content Not Indexed

Hi everyone,

I’m having a problem with XWiki v16.10.8 regarding search functionality and included pages.

I have two pages: Page1 and Page2.
Page2 includes content from Page1 using macros like {{display reference=“Page1.WebHome”/}} and/or {{include reference=“Page1.WebHome”/}} (I’ve also tried page instead of reference).

The issue is that when I search for text that is present in Page1 (and thus visually appears on Page2 due to the inclusion), the search results only return Page1. I’d like Page2 to also appear in the search results, as it effectively contains the searched content when viewed.

Is there a way to configure XWiki’s search (or Solr, if that’s the underlying issue) to index the content of included pages as part of the including page’s content? Or am I misunderstanding how the search indexing works with inclusions?

Any help or suggestions would be greatly appreciated!

Thanks!

Hello. AFAIK we don’t index rendered content with macro executions. We index before the macros are executed. It would be very weird to index with macros since macro’s execution can depend on lots of parameters: if the connected user has specific rights, the display might be dynamic and depend on tons of parameters, etc.

In your case of display/include, you could imagine that your user has the view right on the included page but someone else hasn’t. And if it was indexed as you want, then suddenly we would have a security issue, as the result would be viewable by the user without the right to view the included page.

So it’s very hard to know which macros are “static” from macros for which content depends on factors.

1 Like