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

@Query problem with more of 10 params [DATASOLR-296] #345

Closed
spring-projects-issues opened this issue Apr 11, 2016 · 5 comments
Closed

@Query problem with more of 10 params [DATASOLR-296] #345

spring-projects-issues opened this issue Apr 11, 2016 · 5 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Apr 11, 2016

tkerambloch opened DATASOLR-296 and commented

Hello,

I have a {{@Query{{ with over 10 params, the problem is that when Spring is doing param replacement, the "?10" param is not equals to the 10'th parameter of the fonction.

public interface ShopRepository extends SolrCrudRepository<Shop, String> {
@Query("location: [?0,?1 TO ?2,?3] AND country_id: ?4 AND region_id: ?5 AND city_id: ?6 AND district_id: ?7 AND dealer_id: ?8 AND NOT tags: *?9* AND brand: *?10* AND lang_code: ?11")
    ArrayList<Shop> findByBoundingBox(Double southWestLat, Double southWesLng, Double northEastLat, Double northEastLng,
                                      String countryId, String regionId, String cityId, String districtId,
                                      String dealerId, String tags, String brand, String langCode
    );
}

Affects: 1.5.4 (Gosling SR4)

Referenced from: commits 95281ce, b056fcd

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 20, 2016

Christoph Strobl commented

I've tried to reproduce the issue on both, current master and 1.5.x branch but it seems to work as designed. Pls. see b056fc. Am I missing something?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 11, 2017

Srinath commented

Hi I new to solr same issue I'm also getting "2.1.3.RELEASE". is that issue is fixed?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 6, 2019

gergelyrozsonits commented

Hi Christoph Strobl i just run into the same issue with 4.0.9 (or maybe just a similar one?) and as i see the problem is in AbstractSolrQuery at this line:

result = result.replace(group, getParameterWithIndex(accessor, index));

As i see if you are using more then 10 params, when parameter ?1 is being replaced the first two character of (?10) will also be replaced. As a workaround i changed to order of the parameters in the query like this one:

"field1:?0 AND field10:?10 AND field1:?1"

and for me this solves the issue.

 

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 7, 2021

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 14, 2021

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

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

Successfully merging a pull request may close this issue.

None yet
2 participants