Skip to content
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

Index#order - add missing first/last option #924

Open
ChrisKaun opened this issue Jan 29, 2024 · 0 comments
Open

Index#order - add missing first/last option #924

ChrisKaun opened this issue Jan 29, 2024 · 0 comments

Comments

@ChrisKaun
Copy link

Is your feature request related to a problem? Please describe.

I have a use case where a index should return records ordered by a string field, though records with an empty value must be returned first.
Lets assume an index with Person instances that have a first_name field.

Person.new(first_name: 'A')
Person.new(first_name: 'Z') 
Person.new(first_name: null/nil)

The index query should return the person without a first_name first, regardless of the order direction (ascending/descending).

Describe the solution you'd like

The elasticsearch documentation lists an missing-option which would be ideal for my use case.

Additional context

Maybe this option already exists and it's not documented in chewy, but even by looking throught the documentation I couldn't find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant