mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-05 10:12:33 +00:00
DATAES-552 - @Query annotation fail when passing over 10 parameters
Updated the replacePlaceholders methods to use replaceFirst to prevent duplication substitutions. Original Pull Request: #267
This commit is contained in:
parent
179c3079bd
commit
cc8f0c8ab7
@ -32,6 +32,7 @@ import org.springframework.util.Assert;
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Mark Paluch
|
||||
* @author Taylor Ono
|
||||
*/
|
||||
public class ElasticsearchStringQuery extends AbstractElasticsearchRepositoryQuery {
|
||||
|
||||
@ -86,8 +87,9 @@ public class ElasticsearchStringQuery extends AbstractElasticsearchRepositoryQue
|
||||
String result = input;
|
||||
while (matcher.find()) {
|
||||
String group = matcher.group();
|
||||
group = "\\" + group;
|
||||
int index = Integer.parseInt(matcher.group(1));
|
||||
result = result.replace(group, getParameterWithIndex(accessor, index));
|
||||
result = result.replaceFirst(group, getParameterWithIndex(accessor, index));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user