django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.88k stars 947 forks source link

Loading document 'body' from JSONField instead of filesystem #1630

Open pauloxnet opened 3 weeks ago

pauloxnet commented 3 weeks ago

The body of a Document is loaded from a JSON file from the filesystem:

As we already store the JSON file in metadata field in the Document:

It would be better to load the body from the metadata

jacklinke commented 2 weeks ago

Yep. The field already exists & is populated, and is also the source from which the full-text search gets its information, so it makes sense that it should be the sole source of truth.

I imagine this was the original goal when the JSONField was added to the Document model.

pauloxnet commented 2 weeks ago

My original goal when I added the JSONfield was only to be able to access all the information to create a full-text index. I was not so into the website code to know how the page load was working. I realized this only recently looking at the code for some improvement. At this point it would be better to upgrade the website to Django 5.1 so that we can use the GeneratedField to simplify this step