Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 935D4EF25 for ; Tue, 12 Feb 2013 10:57:11 +0000 (UTC) Received: (qmail 70215 invoked by uid 500); 12 Feb 2013 10:57:06 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 69937 invoked by uid 500); 12 Feb 2013 10:57:01 -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 69891 invoked by uid 99); 12 Feb 2013 10:57:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 10:57:00 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of youngestachiever@gmail.com designates 209.85.217.176 as permitted sender) Received: from [209.85.217.176] (HELO mail-lb0-f176.google.com) (209.85.217.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 10:56:52 +0000 Received: by mail-lb0-f176.google.com with SMTP id s4so32477lbc.35 for ; Tue, 12 Feb 2013 02:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=/iSEukazRRxHaO2vUe5DX5BqmEvZYajdswPn0PB2K34=; b=S1Etze3D0kBTxDiyYC+7xk903hOHJyJ1PkU8dL/sn0IBk8IrXNzq7gW+EpcbUlw4sv rJHxVhtTXGhgC91RGPwEe8ufBdY3MSLlhifTjJ0C9719910daLhF+9E5h2ZMQtyvG8TQ jWAzAP6mgbKjDbF42mmIw1KOVkyiWu7vYKlul+QzoZrDS0Oq12tICpbv6a44OqRJdXvx A3Eq7Nhe6jBPEKaWva0gl9nXl29MdzB29O15IepTwWeM6JDq5uaShCPCs3k9Nt7M7Y5W Bc8pL9fs9GQMWKJUskox6BFSe5Y7pusXJwvRRtG5m8+8JLKSpH2VvmL5iVKcUtTJOcSD cAmw== MIME-Version: 1.0 X-Received: by 10.112.40.129 with SMTP id x1mr7099347lbk.95.1360666590999; Tue, 12 Feb 2013 02:56:30 -0800 (PST) Received: by 10.114.15.73 with HTTP; Tue, 12 Feb 2013 02:56:30 -0800 (PST) In-Reply-To: References: Date: Tue, 12 Feb 2013 16:26:30 +0530 Message-ID: Subject: Re: Strange behavior of term queries with StoredFields - 4.1 From: Ramprakash Ramamoorthy To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=e0cb4efe323ed0754504d584e01e X-Virus-Checked: Checked by ClamAV on apache.org --e0cb4efe323ed0754504d584e01e Content-Type: text/plain; charset=ISO-8859-1 Ian and et al, Just a doubt. Now that I have to index and store(disk space is a constraint here). I have identified that storing as byte[] helps save some disk. But it isn't possible to index a byte[], am getting an exception when the field to be indexed is a byte[]. So how do I go about this? On Mon, Feb 11, 2013 at 8:43 PM, Ian Lea wrote: > Yes, that looks fine. As far as I'm aware the compression is low > level and transparent to user code. > > > -- > Ian. > > > On Mon, Feb 11, 2013 at 2:59 PM, Ramprakash Ramamoorthy > wrote: > > On Mon, Feb 11, 2013 at 7:10 PM, Ian Lea wrote: > > > >> StoredField does indeed only store the field, not index it. > >> MatchAllDocs will find it because, by definition, it matches all docs. > >> But other queries won't. > >> > > > > That was pretty clear Ian. Thanks a lot. > > > >> > >> Not sure what you mean when you say you are particular about stored > >> fields. If you need to get it back from the index, store it. If you > >> don't, don't. Same for indexing - don't index fields you don't need > >> for searching. > >> > > > > All my fields are supposed to be searchable(indexed) and stored as well.I > > was actually trying to leverage the new stored fields compression in 4.1. > > So when I say, > > > > IndexWriterConfig indexWriterConfig = new > > IndexWriterConfig(Version.LUCENE_41, analyzer); > > fieldType.setIndexed(true); > > fieldType.setStored(true); > > fieldType.setTokenized(false); > > doc.add(new Field("published", b.getPublished(), fieldType)); > > > > This means that my docs will be indexed and stored in the compressed > > format? Hope I am right this time? Thanks Ian. > > > >> > >> > >> -- > >> Ian. > >> > >> > > > > > > > >> > >> On Mon, Feb 11, 2013 at 12:53 PM, Ramprakash Ramamoorthy > >> wrote: > >> > Team, > >> > > >> > I am facing a strange issue with term queries and stored > >> fields. > >> > Here is how I index and fetch the query results, > >> > > >> > Case 1 : > >> > doc.add(new StoredField("published", b.getPublished())); > >> > Query query = new MatchAllDocsQuery(); > >> > > >> > Results : No of hits : 8(Expected) > >> > > >> > Case 2 : > >> > doc.add(new StoredField("published", b.getPublished())); > >> > Query query = new TermQuery(new Term("published", "2012")); > >> > > >> > Result : No of hits : 0 (Expected - 4) > >> > > >> > Case 3 : > >> > doc.add(new Field("published", b.getPublished(), fieldType)); > >> > Query query = new TermQuery(new Term("published", "2012")); > >> > > >> > Result : No of hits : 4(Expected) > >> > > >> > Does StoredField means only store and no index? But in that case, how > >> does > >> > the match all docs query work? I am puzzled. > >> > > >> > I am particular about stored fields, because of the compressed size of > >> the > >> > index. How do I go about this? Or am I missing something that is > >> obviously > >> > basic. Please help. > >> > > >> > -- > >> > With Thanks and Regards, > >> > Ramprakash Ramamoorthy, > >> > India. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >> For additional commands, e-mail: java-user-help@lucene.apache.org > >> > >> > > > > > > -- > > With Thanks and Regards, > > Ramprakash Ramamoorthy, > > India > > +91 9626975420 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > -- With Thanks and Regards, Ramprakash Ramamoorthy, India. +91 9626975420 --e0cb4efe323ed0754504d584e01e--