Closed dnsl48 closed 7 years ago
It's a bit of a bummer that we have to render the html to then strip it but I don't see how else it can be done. The JSON structure doesn't seem very easy to traverse.
Would DraftailTextField need the same fix?
Yes, the text field implementation should be updated as well. I'm also going to implement some tests. Will be doing things within this PR.
About having to render the content first - it's not a biggie, since wagtail database search backend doesn't support extra fields anyways, whereas Elasticsearch takes the stuff from fields only once - at the indexing stage (it's either on model update, or even in a celery/cron background job)
Will add tests as part of in #27.
Currently DraftTextBlock returns its JSON stuff as the searchable content. We want it to be the rendered document instead.