You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes a few different issues, which we should address by refactoring it:
There is currently no way to return facets with this approach. It treats each Hit as an object, but the facets are returned at the top-level. In particular, the serializer doesn't even get access to the facet, because it's only passed each Hit object.
Currently the count returned in by the docsearch REST API is wrong. I believe this is because of the way we're filtering the results, but I think it might be happening after pagination.
We might be able to work around these limitations, but I think the proper solution is to build the REST API using a custom approach, and pass the data in from Search directly, instead of trying to depend on the fact that Search's look like Queryset's.
The text was updated successfully, but these errors were encountered:
The recommended way of using pagination over
a custom object is to manage the class ourselves.
I tried rely on most of the defaults of the DRF's pagination class.
Closes#5235
Uh oh!
There was an error while loading. Please reload this page.
Currently the way our Docsearch works abuses the fact that ElasticSearch DSL Search objects look like querysets:
https://github.com/rtfd/readthedocs.org/blob/2bf6e9943c4177d11e125fd077a07f7168fce044/readthedocs/search/api.py#L16-L28
This causes a few different issues, which we should address by refactoring it:
facets
with this approach. It treats eachHit
as an object, but thefacets
are returned at the top-level. In particular, the serializer doesn't even get access to the facet, because it's only passed eachHit
object.count
returned in by the docsearch REST API is wrong. I believe this is because of the way we're filtering the results, but I think it might be happening after pagination.We might be able to work around these limitations, but I think the proper solution is to build the REST API using a custom approach, and pass the data in from Search directly, instead of trying to depend on the fact that
Search
's look likeQueryset
's.The text was updated successfully, but these errors were encountered: