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

Exception occurred in assertion #22

Closed
yl3w opened this issue Apr 4, 2013 · 2 comments
Closed

Exception occurred in assertion #22

yl3w opened this issue Apr 4, 2013 · 2 comments
Assignees

Comments

@yl3w
Copy link

yl3w commented Apr 4, 2013

An mvn clean package on this repository includes an example that fails. it is infact amongst the first examples I tried and might be a user error.

The exception occurs in spring-data-elasticsearch, the results from ES itself are what I would expect.

https://github.com/maddalab/sample-es-application

@mohsinh
Copy link
Member

mohsinh commented Apr 5, 2013

Thanks you so much for rectifying it !

Agree documentation part of spring data elasticsearch is wrong for your test case. I will change that for sure.

It will return a single Object as internally it will call queryForObject of ElasticsearchTemplate class.
If you want multiple records please call for Page request.

Initially we implemented support for List but it is not feasible as you could have 1000s of record and you don’t want to load all of them in a list at a time.
Hence List is replaced by Page request. And you can easily get List by using getContent() method of Page.

I have added two test cases for detail information , you can always fork sample application project and add more test cases and play around !

Test

I will talk to my team about repository methods that return List with Pageable request. If it will be feasible then it will be available soon

also you are using Client in your test case to delete data from index, which is not required as repository has deleteAll() default method to do that(see test case for more detail)

Hope that helps
Let me know if you still have doubt

@ghost ghost assigned mohsinh Apr 5, 2013
@mohsinh
Copy link
Member

mohsinh commented Apr 9, 2013

Support for repository and template to have methods which will return List is added...

please see below test cases for more information...

Test

@mohsinh mohsinh closed this as completed Apr 9, 2013
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

2 participants