开发者

How do I retrieve Haystack SearchQuery parameters

开发者 https://www.devze.com 2023-04-10 04:01 出处:网络
I am looking for a way to serialize a Haystack search query (not the query results) so that I can reconstruct it later.Is there a way to do this without having to intercept the parameters from off of

I am looking for a way to serialize a Haystack search query (not the query results) so that I can reconstruct it later. Is there a way to do this without having to intercept the parameters from off of the req开发者_Go百科uest object?

For context, I want users to be able to subscribe to the results of a particular search, including any new results that may pop up over time.

Edit:

I settled on storing the search with:

filter = queryset.query.query_filter

and then loading this back in using:

SearchQuerySet().raw_search(filter)

Though I suspect this will tie me to whichever particular search back-end I'm using now. Is this true? Is there a better way?


You should have the query in your request.GET. Then it should be fairly easy to construct a RSS Feed using that query.

0

精彩评论

暂无评论...
验证码 换一张
取 消