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
Support random sort order for Lucene queries #6916
Comments
I suggest the following syntax: order by DisplayText ascending, then by random
order by DisplayText descending, then by random
order by random
order by DisplayText ascending, then by CreatedUtc ascending
|
Sounds sensible, perhaps you could open the pr, and we can review? |
@deanmarcussen Did you have a chance to look at the PR? |
How does ElasticSearch support it? The syntax seems odd. |
I wasn't aware that the queries are also used by ElasticSearch. Any idea how to implement this feature then? |
ElasticSearch supports this by using a random_score leaf within a function_score:
Edit function_score is being deprecated: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html#script-score-function-score-transition So something like this:
Not quite sure how to implement this in the Lucene module though. |
Let's make an extended research on how this should be implemented to make sure. Else, this is just a matter of parsing the json differently with a new "script_score" Query Provider. Remember that we can nest those Queries. |
@Skrypt Have you investigated how we can add support for random sort order? |
Your solution works for a global random sort but ElasticSearch queries uses the |
Add support for random sort order results of Lucene queries. I have a PR that enables this behavior.
I was wondering how to add this support to the documentation.
The text was updated successfully, but these errors were encountered: