Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full Text Index for Widgets/Bag Items #7128

Closed
deanmarcussen opened this issue Sep 23, 2020 · 7 comments · Fixed by #7357
Closed

Full Text Index for Widgets/Bag Items #7128

deanmarcussen opened this issue Sep 23, 2020 · 7 comments · Fixed by #7357
Milestone

Comments

@deanmarcussen
Copy link
Member

For pages that are built with a BagPart or a Widget what would be the best approach to include the content of these Contained Items in the FullTextIndex?

I have a rudimentary BodyAspect handler working which looks for all HtmlFields inside the BagPart content items, but it has limitations.

Principally with this rudimentary approach, only HtmlFields are covered, so titles / captions for media fields (which in this case are textfields, and I could include, but haven't at this stage).

The two options I'm seeing is

  • What I have which has limitations
  • Calling BuildDisplay on all the ContentItems contained, and executing these shapes into an HtmlContentBuilder

BuildDisplay is going to potentially end up giving me a lot of html tags / theme related output, but it was also mentioned that we're stripping html tags before they go into the lucene index?

The key issue here is that as the pages are built from many contained content items, they don't have a standard html body to build an aspect from.

/cc @Skrypt

@Skrypt
Copy link
Contributor

Skrypt commented Sep 23, 2020

What you mean by limitations?

@deanmarcussen
Copy link
Member Author

I think I probably need to be calling recursive fulltextaspects on each content item in the bags so I can take advantage of the liquid templating for custom index fields on each of the content types inside the bag.

The limitation is that the bags have more than just html fields, sometimes nested bags, but I think recursive fulltextaspects will sort it.

Will see tomorrow

@Skrypt
Copy link
Contributor

Skrypt commented Sep 23, 2020

I thought you meant that you we're hitting some performance bottleneck but yes using the FullTextAspect on each content items inside the bags should be the way to go. This way it is configurable and each content item should already be indexed unless it's broken. @hswami did that part where we index the bagparts. I will let you work on it and take a look when you push some draft PR.

@Skrypt
Copy link
Contributor

Skrypt commented Sep 23, 2020

Also after thinking about this twice. There is probably no need to create an indexation on something already indexed. Probably what you need is a proper custom ElasticSearch Query unless we are missing some parts which needs to be added to the index.

@deanmarcussen
Copy link
Member Author

ok, so got this working.

Yes the BagParts are indexed, but not as part of the FullText index.

So it's either add a lot of fields to the default search index settings for all the bag parts or ...

Have a liquid filter for the FullTextAspect so that in the CustomFullText settings we can do

{% for contentItem in Model.Content.BagPart.Contentitems %}
  {{ contentItem | full_text_aspect }}
{% endfor %}

@hswami
Copy link
Contributor

hswami commented Sep 24, 2020

Dean, that would be a useful feature to have. I don't know what it would take to add it but I'm sure it can be figured out. Do you want to take a crack at it or would you prefer I do?

@sebastienros
Copy link
Member

I think you can just iterate over each bag part item in the custom full text configuration, the one using Liquid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants