You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Ryan McKinley (JIRA)" <ji...@apache.org> on 2007/12/27 06:42:43 UTC
[jira] Created: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
--------------------------------------------------------------------------------
Key: SOLR-446
URL: https://issues.apache.org/jira/browse/SOLR-446
Project: Solr
Issue Type: Improvement
Affects Versions: 1.3
Reporter: Ryan McKinley
Fix For: 1.3
ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554525 ]
Ryan McKinley commented on SOLR-446:
------------------------------------
code extracted from SOLR-303 and added a small interface to reuse some code
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hoss Man reopened SOLR-446:
---------------------------
sorry, i just noticed something ... in commit r610156 the new "writeDoc(String name, SolrDocument doc, Set<String> returnFields, boolean includeScore)" methods all seem to be ignoring the "returnFields" param completely.
doesn't that mean any handler using SolrDocument's won't respect the "fl" param?
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Assignee: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557887#action_12557887 ]
Ryan McKinley commented on SOLR-446:
------------------------------------
good catch Hoss!
Looking at it again, the 'score' bit is weird too -- you would get duplicate 'score' fields if you chained this (i think)
{code:java}
if (includeScore) {
writeVal("score", doc.getFirstValue("score"));
}
{code}
perhaps it should be:
{code:java}
Index: src/java/org/apache/solr/request/XMLWriter.java
===================================================================
--- src/java/org/apache/solr/request/XMLWriter.java (revision 610424)
+++ src/java/org/apache/solr/request/XMLWriter.java (working copy)
@@ -342,11 +342,14 @@
startTag("doc", name, false);
incLevel();
- if (includeScore) {
- writeVal("score", doc.getFirstValue("score"));
+ if (includeScore && returnFields != null ) {
+ returnFields.add( "score" );
}
for (String fname : doc.getFieldNames()) {
+ if (returnFields!=null && !returnFields.contains(fname)) {
+ continue;
+ }
Object val = doc.getFieldValue(fname);
if (val instanceof Collection) {
{code}
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Assignee: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan McKinley updated SOLR-446:
-------------------------------
Attachment: SOLR-446-WriteSolrDocument.patch
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan McKinley resolved SOLR-446.
--------------------------------
Resolution: Fixed
Assignee: Ryan McKinley
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Assignee: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ryan McKinley resolved SOLR-446.
--------------------------------
Resolution: Fixed
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Assignee: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-446) TextResponseWriter should be able to
work with SolrDocument and SolrDocumentList
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557027#action_12557027 ]
Yonik Seeley commented on SOLR-446:
-----------------------------------
looks good on a quick scan, go for it!
> TextResponseWriter should be able to work with SolrDocument and SolrDocumentList
> --------------------------------------------------------------------------------
>
> Key: SOLR-446
> URL: https://issues.apache.org/jira/browse/SOLR-446
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 1.3
> Reporter: Ryan McKinley
> Fix For: 1.3
>
> Attachments: SOLR-446-WriteSolrDocument.patch
>
>
> ResponseWriters should be able to write SolrDocuments the same way they write Documents. This will be useful for SOLR-303 or other RequestHandlres that modify a SolrDocument and return the result.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.