-
Couldn't load subscription status.
- Fork 151
Adding answers to solr indexing #114
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
Conversation
|
Any questions about this PR? The schema updates conflict with the fix for #116. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like to depend on a toString implementation, maybe there's something like Collectors.joining from java 8 (http://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#joining-java.lang.CharSequence-) in guava api that we can use?
|
sorry for the delay, besides that toString comment everything seems fine... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, there's a Guava utility that joins collections. I was just keeping to the original implementation, but I don't mind switching one bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you improve that now :-)
Chico Sokol
On Mon, Nov 3, 2014 at 3:59 PM, monitorjbl [email protected] wrote:
In src/main/java/org/mamute/search/SolrQuestionIndex.java:
String answer = null;List<String> responses = new ArrayList<>();for (Answer a : q.getAnswers()) {if (a.isSolution()) {answer = a.getDescription();} else {responses.add(a.getDescription());}}
if (answer != null) {doc.addField("answer", answer);}if (responses.size() > 0) {doc.addField("responses", responses.toString().replace("[", "").replace("]", ""));}Sure, there's a Guava utility that joins collections. I was just keeping
to the original implementation, but I don't mind switching one bit.—
Reply to this email directly or view it on GitHub
https://github.com/caelum/mamute/pull/114/files#r19751084.
87155fb to
1676cba
Compare
|
Switched over to using Guava's |
|
Great! Thanks! |
Fixes #98