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
So my problem is related to a query that performs a text search. After the text search is done, I want to sort the results by the Meta score "textScore", so I use the sort method of the FindOptions class that accepts a Meta argument. But in native mongo, it's possible to also sort by another field, in case scores have the same values. The problem is you can't add another sort field if you use the sort method that accepts the Meta parameter.
I'd like to have a way to specify both sorting options: sort by textScore, and the sort by another field.
I can sort after the query is done, using java Comparators, but it's a pity something you can actually do in native mongo can't be replicated in morphia.
Mongo query that works, with sort options (one is the Meta score, the other is another field:
So my problem is related to a query that performs a text search. After the text search is done, I want to sort the results by the Meta score "textScore", so I use the sort method of the FindOptions class that accepts a Meta argument. But in native mongo, it's possible to also sort by another field, in case scores have the same values. The problem is you can't add another sort field if you use the sort method that accepts the Meta parameter.
I'd like to have a way to specify both sorting options: sort by textScore, and the sort by another field.
I can sort after the query is done, using java Comparators, but it's a pity something you can actually do in native mongo can't be replicated in morphia.
Mongo query that works, with sort options (one is the Meta score, the other is another field:
The text was updated successfully, but these errors were encountered: