Skip to content

findAllById is limited default elasticsearch response size and not iterable size #2417

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

Closed
SirBigoo opened this issue Jan 2, 2023 · 1 comment · Fixed by #2421
Closed
Labels
type: bug A general bug

Comments

@SirBigoo
Copy link

SirBigoo commented Jan 2, 2023

Hello,

It seems that findAllById method on CRUD Repository (implemented in SimpleElasticsearchRepository) do not take iterable parameter size to search by IDs.

If passing more than 10 ids in iterable, Elasticsearch will return only first 10 results because of generated query :

{
	"query": {
		"ids": {
			"values": [
				"a030900000E9eSSAAZ",
				"a030900000E9eLPAAZ",
				"a030900000E9artAAB",
				"a030900000E9abWAAR",
				"a030900000BubyVAAR",
				"a030900000EAUCwAAP",
				"a030900000E9apzAAB",
				"a030900000E9hNYAAZ",
				"a030900000EABUFAA5",
				"a030900000EABQpAAP",
				"a030900000E9azSAAR",
				"a030900000EAUDKAA5",
				"a030900000EArpaAAD",
				"a030900000E9apzAAB",
				"a030900000E9apQAAR",
				"a030900000FwfWRAAZ",
				"a030900000E9eLPAAZ",
				"a030900000EARdSAAX",
				"a030900000E9h6SAAR",
				"a030900000EAflkAAD"
			]
		}
	}
}

I have a total response ok (size of iterable) but not hits (size of 10 default size).

I workaround it by doing a getById for each element, but not really performant :D

@SirBigoo SirBigoo changed the title findAllById is limited by default elasticsearch response size findAllById is limited default elasticsearch response size and not iterable size Jan 2, 2023
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 2, 2023
@sothawo sothawo added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 2, 2023
@sothawo
Copy link
Collaborator

sothawo commented Jan 2, 2023

I agree that in this case the number of input values should determine the number of documents returned from Elasticsearch.

sothawo added a commit to sothawo/spring-data-elasticsearch that referenced this issue Jan 4, 2023
sothawo added a commit that referenced this issue Jan 4, 2023
@sothawo sothawo added this to the 5.1 M1 (2023.0.0) milestone Jan 4, 2023
sothawo added a commit that referenced this issue Jan 4, 2023
Original Pull Request #2421
Closes #2417

(cherry picked from commit 28489ff)
sothawo added a commit that referenced this issue Jan 4, 2023
Original Pull Request #2421
Closes #2417

(cherry picked from commit 28489ff)
(cherry picked from commit 6551a80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants