- ๐ซ๐ฎFinland lauriii Finland
I feel like we are talking past each other with different use cases and scenarios and concerns that are not being impacted by Experience Builder. My understanding is that there are two primary ways of configuring Search API: text based search and faceted search (as well as combination of the two).
When using text based search and the intent is to index the whole page, the "Rendered HTML output" with the default content type template (same as what user would see when navigating to the page) should be used. Search API would allow configuring other view modes to be used for indexing but those wouldn't include the content added to the slots, but only content that is being rendered through those view modes. So long as we keep view modes working, this should all work without specifically having to accommodate them. This is the same experience that you would get when using Layout Builder today.
When using the text based search, the results would often display an excerpt which is generated based on what is in the index. This allows highlighting the text that is being matched. This shouldn't require any special accommodations from XB so long as what is stored in the index is sensible.
When implementing a faceted search, it's common to configure the results to display to using a view mode like cards or search result. In this scenario, text is not being highlighted. Even in this scenario, the index may include the full rendered page, highlighting that the index is a separate concern from the presentation of the results.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
#17: that's not matching what you said earlier โ .
Unless you meant that that would be the initial state, and you intend to only use the default content type template for search indexing and a different content type template for presenting search results?
But if we do that, then it follows that the information that was matched is absent from the search result's presentation, meaning highlighting is impossible.
- ๐ฌ๐งUnited Kingdom catch
@lauriii that's the opposite of what this says in #7:
Last but not least: per @lauriii, there won't be a "search" or "search index" view mode for XB โ search must be configured to use the "default" view mode's representation of content entities both for 1) crafting a search index to power the search, 2) presenting search results.
is there a miscommunication somewhere?
If search results use a view mode for rendering (which a lot of sites do), then it shouldn't require any special handling in XB, it just needs to not break using view modes for rendering.
The place where it might get tricky is 'results snippet' type situations where the search result is trying to show the searched keywords in the context of the results. I'm not sure how that's generally implemented in search API or not or whether it would need special handling. For me that's the least important aspect to worry about - it's the initial indexing that feels unresolved still.
- ๐ซ๐ฎFinland lauriii Finland
Rendering Search results in the same way as the content's detail page doe not seem like the most commonly chosen way of configuring it. I did a quick poll at the contribution room at Drupal Mountain Camp, and everyone who answered me always configures some kind of teaser, card or search-result view mode when rendering a search result page.
We should definitely support configuring customizing how content is displayed in the search results page. I'm not sure we need to do that in this issue though because it might make sense to design and implement solution specifically for that, because it's such a common use case.
- ๐ฌ๐งUnited Kingdom catch
When needing complete control over what all is indexed, it should be indexed using fields, because then it's possible to boost per-field. It gives a lot more control.
This however would mean something like https://www.drupal.org/project/layoutbuilder_search_api โ for all components/props
I think that ๐ Refactor the XB field type to be multi-valued, to de-jsonify the tree, and to reference the field_union type of the prop values Active would also handle this - because the props would be available as field data to search API then without an additional translation layer.
- ๐ง๐ชBelgium borisson_ Mechelen, ๐ง๐ช
Last but not least: per @lauriii, there won't be a "search" or "search index" view mode for XB โ search must be configured to use the "default" view mode's representation of content entities both for 1) crafting a search index to power the search, 2) presenting search results. Related: ๐ฑ [META] Support alternative renderings of prop data added for the 'full' view mode such as for search indexing or newsletters Active and ๐ Create a configurable search api processor for XB data Active
It's not clear to me yet how that avoids the
but without elements that would 'pollute' the search results like field labels, related content blocks, CTAs, social widgets etc. so that if I search for "newsletter" or "Facebook" I don't get every article on the site back in the results, but only the ones with content actually mentioning newsletters or Facebook.
problem described in ๐ฑ [META] Support alternative renderings of prop data added for the 'full' view mode such as for search indexing or newsletters Active though.
Rendering Search results in the same way as the content's detail page doe not seem like the most commonly chosen way of configuring it. I did a quick poll at the contribution room at Drupal Mountain Camp, and everyone who answered me always configures some kind of teaser, card or search-result view mode when rendering a search result page.
For the indexation part, I also don't see a way that would remove those pollutions without having a seperate view mode, but I personally think that's not as bad. When needing complete control over what all is indexed, it should be indexed using fields, because then it's possible to boost per-field. It gives a lot more control.
This however would mean something like https://www.drupal.org/project/layoutbuilder_search_api โ for all components/props, which is another approach that could be taken. This removes the double rendering that catch talked about in #13.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This blocks pretty much everything in ๐ฑ [META] 7. Content type templates โ aka "default layouts" โ clarify the tree+props data model Active .
In more concrete terms, it blocks ๐ Prevent fields from being deleted if they are used in Experience Builder field's dynamic prop values Active .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
-
๐
Tighten validation: only allow StaticPropSource in XB fields + PageTemplate, DynamicPropSource in ContentTypeTemplate
Active
started forbidding
DynamicPropSources
from being used in XB fields (i.e. in a specific content entity's XB component tree). - I'm working with @lauriii to refine the plan for ๐ฑ [META] 7. Content type templates โ aka "default layouts" โ clarify the tree+props data model Active . The direction that is going, it looks like the tightened validation we introduced in #3481720 will become permanent.
That means that the issue title/scope here is wrongContentTypeTemplate will simply have to reflect every
DynamicPropSource
in its component tree as an explicit config dependency.If we do that, then Drupal's config dependency system takes care of this problem for us! We should still confirm it with explicit test coverage though, and that's what this issue is about.
IOW: ๐ [PoC] Introduce a `ContentTypeTemplate` config entity Active should have introduced the necessary config dependencies already, and it should be up to this issue to add explicit test coverage for it.
-
๐
Tighten validation: only allow StaticPropSource in XB fields + PageTemplate, DynamicPropSource in ContentTypeTemplate
Active
started forbidding
- ๐ฌ๐งUnited Kingdom catch
Last but not least: per @lauriii, there won't be a "search" or "search index" view mode for XB โ search must be configured to use the "default" view mode's representation of content entities both for 1) crafting a search index to power the search,
afaict this is incompatible with ๐ Create a configurable search api processor for XB data Active - which is suggesting not rendering XB at all when configuring search indexing, except via the special search API processor. I'm not convinced by that issue yet (and left a question on there which hasn't been answered yet) but has that been abandoned or is this a mistake? Using ๐ Create a configurable search api processor for XB data Active would mean either not using a view mode at all in search indexing, or a view mode minus XB data that only shows entity fields, with the XB data then provided by the separate processor.
If you had to use the default view mode and the processor it would mean double-rendering when search indexing.
2) presenting search results.
This seems unnecessarily restrictive and also unenforceable. e.g. you can configure search API views to return results from a search index, then use any view mode on the entity that you like right now - like displaying search results as a grid of cards or whatever.