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

Auto prefix/suffix map values [DATASOLR-202] #321

Closed
spring-projects-issues opened this issue Sep 11, 2014 · 6 comments
Closed

Auto prefix/suffix map values [DATASOLR-202] #321

spring-projects-issues opened this issue Sep 11, 2014 · 6 comments
Assignees
Labels
type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Sep 11, 2014

Christoph Strobl opened DATASOLR-202 and commented

using @Indexed("*_s") Map<String, String> lang; should suffix/prefix the keys in the map on insert and remove the prefix when loading back into the bean.

might be useful to have this though one should be able to turn this on/off using some special property.

Maybe an @Dynamic field property would make sense to that we collect properties with given values into one map or so....


Issue Links:

  • DATASOLR-237 Spring Data Solr with Dynamic Field not working
    ("is duplicated by")

  • DATASOLR-237 Spring Data Solr with Dynamic Field not working

  • DATASOLR-308 Auto pre/suffix map values does not work for trailing wildcards

Referenced from: pull request #54

2 votes, 4 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 4, 2015

Vladimir Tsanev commented

It seems that this is not working correctly for trailing wildcards. I have

@Dynamic
@Indexed("title_*")
Map<String, String> title;

But when I save my objects

...
content.title = Collections.singletonMap("en", "Solr Demo");
...
repository.save(content);

I end up with following filed in solr entitle_ I would expect it to be title_en.

While debugging I think I located the problem here
https://github.com/spring-projects/spring-data-solr/blob/master/src/main/java/org/springframework/data/solr/core/convert/MappingSolrConverter.java#L299

Shouldn't this

key = WildcardPosition.getAppropriate(key).createName(fieldName, key);

be

key = WildcardPosition.getAppropriate(fieldName).createName(fieldName, key);

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 4, 2015

Francisco Spaeth commented

Vladimir Tsanev: thanks for pointing it out.

Christoph Strobl: could you review the changes I have done on PR#54. Thanks!

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 4, 2015

Vladimir Tsanev commented

On my side the changes are working as expected. Thanks Francisco Spaeth

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 22, 2015

Vladimir Tsanev commented

Sorry to bring this issue again, but will the fixed be merged?

@spring-projects-issues
Copy link
Author

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

Petar Tahchiev commented

+1 On this. It's been almost a year now and we have a pull request for it

@spring-projects-issues
Copy link
Author

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

Christoph Strobl commented

closing this one again in favor of DATASOLR-308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants