Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 82589 invoked from network); 11 Jun 2008 12:05:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2008 12:05:55 -0000 Received: (qmail 51796 invoked by uid 500); 11 Jun 2008 12:05:51 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 51751 invoked by uid 500); 11 Jun 2008 12:05:51 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 51740 invoked by uid 99); 11 Jun 2008 12:05:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 05:05:51 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.247.21.92] (HELO mail.local.wis.nl) (83.247.21.92) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 11 Jun 2008 12:05:00 +0000 Content-class: urn:content-classes:message Subject: RE: Is it possible to get only one Field from a Document? MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Jun 2008 14:05:00 +0200 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Message-ID: <50CA25BD6EEA954FA592C097399942E319B5327C@CM1.wis.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Is it possible to get only one Field from a Document? thread-index: AcjLtnQdjIwmm2qoRVCIiDZP7DTk/AAAaInAAAC8N+A= References: <484FB6EE.2050209@digitro.com.br> <50CA25BD6EEA954FA592C097399942E319B53279@CM1.wis.local> From: "Daan de Wit" To: X-Virus-Checked: Checked by ClamAV on apache.org But I doubt this will solve your memory issue because nonstored fields = are not read when retrieving the document. -----Original Message----- From: Daan de Wit [mailto:d.de.wit@wis.nl]=20 Sent: Wednesday, June 11, 2008 13:44 To: java-user@lucene.apache.org Subject: RE: Is it possible to get only one Field from a Document? This is possible, you need to provider a FieldSelector to = IndexReader#document(docId, selector). This won't work with Hits though, = because Hits does not expose the document number, so you need to roll = your own solution using TopDocs or HitCollector, for information see the = discussion in this issue: = https://issues.apache.org/jira/browse/LUCENE-1290 Kind regards, Daan de Wit -----Original Message----- From: Marcelo Schneider [mailto:marcelo.schneider@digitro.com.br]=20 Sent: Wednesday, June 11, 2008 13:29 To: java-user@lucene.apache.org Subject: Is it possible to get only one Field from a Document? I have a environment where we have indexed a DB with about 6mil entries=20 with Lucene, and each row has 25 columns. 20 cols have integer codes=20 used as filters (indexed/unstored), and the other 5 have (very) large=20 texts (also indexed/unstored). Currently the search I'm doing is like = this: Hits hits =3D searcher.search(query); for (int i =3D 0; i < this.hits.length(); i++) { Document doc =3D this.hits.doc(i); String s =3D doc.get("fieldWanted"); // does everything with the result, etc } We are trying to reduce memory usage, however. Is it possible to return=20 a Document object with just the Fields I really need? In the example,=20 each Document have 25 fields, and I just need one... would this=20 theoretically make any difference? --=20 Marcelo Frantz Schneider SIC - TCO - Tecnologia em Engenharia do Conhecimento D=CDGITRO TECNOLOGIA E-mail: marcelo.schneider@digitro.com.br Site: www.digitro.com --=20 Esta mensagem foi verificada pelo sistema de antiv=EDrus da D=EDgitro e acredita-se estar livre de perigo. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org