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 "Yonik Seeley (JIRA)" <ji...@apache.org> on 2007/07/01 18:49:05 UTC

[jira] Commented: (SOLR-280) slightly more efficient SolrDocument implementation

    [ https://issues.apache.org/jira/browse/SOLR-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509431 ] 

Yonik Seeley commented on SOLR-280:
-----------------------------------

I think one should be able to simply set a field value without a copy being made:
 
public Object setField(String name, Collection value)  {
  return _fields.put(name, value);
}

One area I'm concerned about performance is on the output side of things.
If we added an extension point to manipulate documents before they are written to the response, it makes sense to use SolrDocument there rather than Lucene's Document.... but we may be constructing 100 in the course of a response.  Just something to keep in mind.

Another thing to keep in mind is that if it complicates things having SolrInputDocument inherit from SolrDocument, that relationship isn't needed (is it?)


> slightly more efficient SolrDocument implementation
> ---------------------------------------------------
>
>                 Key: SOLR-280
>                 URL: https://issues.apache.org/jira/browse/SOLR-280
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>            Priority: Minor
>         Attachments: SOLR-280-SolrDocument2.patch
>
>
> Following discussion in SOLR-272
> This implementation stores fields as a Map<String,Object> rather then a Map<String,Collection<Object>>.  The API changes slightly in that:
>  getFieldValue( name ) returns a Collection if there are more then one fields and a Object if there is only one.
> getFirstValue( name ) returns a single value for the field.  This is intended to make things easier for client applications.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.