Skip to content

8.15 - What is the intended method to use the .MatchAll() query? #8523

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

Open
TSlump opened this issue May 13, 2025 · 2 comments
Open

8.15 - What is the intended method to use the .MatchAll() query? #8523

TSlump opened this issue May 13, 2025 · 2 comments
Labels

Comments

@TSlump
Copy link

TSlump commented May 13, 2025

Elastic.Clients.Elasticsearch version: 8.15.4

Elasticsearch version: 8.15.4

.NET runtime version: 8.0

Hi, I'm trying to get all docs from my elastic index but I'm having trouble with the .MatchAll query. I had imagined it would look like:

var searchResponse = await this.elasticsearchClient.SearchAsync<Model>(s => s
            .Index(Index)
            .Query(q => q
                .MatchAll()
            )); 

However it's asking for a MatchAllQueryDescriptor, I'm sure what I'm meant to put here...

I have a version working with:

.Query(new MatchAllQuery()

Is this the intended method to create a MatchAll query? Any guidance/docs would be be greatly appreciated, thanks.

@TSlump TSlump added 8.x Relates to a 8.x client version Category: Bug labels May 13, 2025
@flobernd
Copy link
Member

flobernd commented May 13, 2025

Hi @TSlump,

the non descriptor based approach is fine to use.

The descriptor syntax is a bit weird in the 8.x client:

.MatchAll(_ => {})

In the 9.x clients we improved the syntax to allow for just:

.MatchAll()

These changes are going to get backported for 8.19.

Please let me know if that answers your question.

@TSlump
Copy link
Author

TSlump commented May 14, 2025

Hi @flobernd , thanks for your response!

That has worked great, I appreciate your help. Thanks again.

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

No branches or pull requests

2 participants