Skip to content

ReactiveElasticsearchOperations indexName twice endcoding #1665

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
wonwoo opened this issue Jan 25, 2021 · 6 comments · Fixed by #1666
Closed

ReactiveElasticsearchOperations indexName twice endcoding #1665

wonwoo opened this issue Jan 25, 2021 · 6 comments · Fixed by #1666
Labels
in: core Issues in core support status: feedback-provided Feedback has been provided type: bug A general bug

Comments

@wonwoo
Copy link

wonwoo commented Jan 25, 2021

this example request

public Mono<Void> example(Foo foo) {
   return reactiveElasticsearchOperations.save(foo, IndexCoordinates.of("<foo-{now/M{yyyy.MM}}>")).then()
}

webClient Request url

Expecting : /%3Cfoo-%7Bnow%2FM%7Byyyy.MM%7D%7D%3E/_doc

but : /%253Cfoo-%257Bnow%252FM%257Byyyy.MM%257D%257D%253E/_doc

elasticsearch error log
reason=Invalid index name [%3Cfoo-%7Bnow%2FM%7Byyyy.MM%7D%7D%3E], must be lowercase]

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 25, 2021
@sothawo
Copy link
Collaborator

sothawo commented Jan 25, 2021

"<foo-{now/M{yyyy.MM}}>" is not a valid index name. The index name must be either a lowercases String or a SpEL (Spring Expression language) template expression. What do you want to achieve with the String you provide?

Check https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-api-path-params for what characters are allowd in an index name.

@sothawo sothawo added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 25, 2021
@wonwoo
Copy link
Author

wonwoo commented Jan 25, 2021

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 25, 2021
@sothawo
Copy link
Collaborator

sothawo commented Jan 25, 2021

Ok; didn't know that. I will need to investigate this and to try to reproduce it.

@sothawo sothawo added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 25, 2021
@sothawo
Copy link
Collaborator

sothawo commented Jan 25, 2021

ok, I can reproduce that. That reactive client escapes the '%' with '%25'. This does not happen in the non-reactive part.

@sothawo sothawo added the in: core Issues in core support label Jan 25, 2021
sothawo added a commit that referenced this issue Jan 25, 2021
@sothawo sothawo added this to the 4.2 M3 (2021.0.0) milestone Jan 25, 2021
sothawo added a commit that referenced this issue Jan 25, 2021
Original Pull Request #1666
Closes #1665

(cherry picked from commit 4829b07)
sothawo added a commit that referenced this issue Jan 25, 2021
Original Pull Request #1666
Closes #1665

(cherry picked from commit 4829b07)
@sothawo
Copy link
Collaborator

sothawo commented Jan 25, 2021

implemented in the current master and backported to 4.1.x and 4.0.x

@wonwoo
Copy link
Author

wonwoo commented Jan 26, 2021

@sothawo good! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support status: feedback-provided Feedback has been provided type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants