lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-509) Performance optimization when retrieving a single field from a document
Date Thu, 02 Mar 2006 20:10:39 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-509?page=comments#action_12368591 ] 

Doug Cutting commented on LUCENE-509:
-------------------------------------

You could:

(a) add a FieldSelector interface and an IndexWriter method that creates a FieldSelector,
then you could pass the FieldSelector instead of the field name to get documents with a subset
of the fields;

(b) add a getDocuments(int[], String[]) method that reads a set of documents with only the
named fields; or

(c) you could store fewer fields in your index.




> Performance optimization when retrieving a single field from a document
> -----------------------------------------------------------------------
>
>          Key: LUCENE-509
>          URL: http://issues.apache.org/jira/browse/LUCENE-509
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Index
>     Versions: 1.9, 2.0
>     Reporter: Steven Tamm
>  Attachments: DocField.patch, DocField_2.patch
>
> If you just want to retrieve a single field from a Document, the only way to do it is
to retrieve all the fields from the Document and then search it.  This patch is an optimization
that allows you retrieve a specific field from a document without instantiating a lot of field
and string objects.  This reduces our memory consumption on a per query basis by around around
20% when a lot of documents are returned.
> I've added a lot of comments saying you should only call it if you only ever need one
field.  There's also a unit test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message