Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 84582 invoked from network); 24 Dec 2008 06:04:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Dec 2008 06:04:01 -0000 Received: (qmail 19338 invoked by uid 500); 24 Dec 2008 06:03:53 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19299 invoked by uid 500); 24 Dec 2008 06:03:53 -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 19288 invoked by uid 99); 24 Dec 2008 06:03:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Dec 2008 22:03:53 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amar.sannaik@gmail.com designates 209.85.198.235 as permitted sender) Received: from [209.85.198.235] (HELO rv-out-0506.google.com) (209.85.198.235) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Dec 2008 06:03:46 +0000 Received: by rv-out-0506.google.com with SMTP id f6so3496763rvb.5 for ; Tue, 23 Dec 2008 22:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=NCtdSZ553WfBiTbE+ZzYgid9VZHXInq7EQIAcyNHdzA=; b=VriMddQVyR98HQL26nVne38kDdRC0xDG2JhGpAQAhAE1VkQsmhPTOBWEFiky/0Kzqe M3myZouZrL3IZodI8bqOSVKdgHIh9fUSPo7fzvwOFsCwHuvL2nDnxxE5lwPewqft5Ndy KOgClUG3G2oW9CPik0RI8a6lOkAYAXsf8JErM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=akeQCOApFBCaLt1R7reGWm0I+2IS0gnvjVOketkbo4wEFzT9HEu3A3SkS8LVV9Favz Mj2RRODgSUZi2Gxi3+NSXgrFnKltb6Le/hovlDz8TriJ6XVab6ysJRlH7SZyOvIT4Z3o jRuow/kxHqAw9CKA3szf5sf/XrbT/qBiuTxtQ= Received: by 10.115.14.1 with SMTP id r1mr5298940wai.27.1230098605849; Tue, 23 Dec 2008 22:03:25 -0800 (PST) Received: by 10.114.155.4 with HTTP; Tue, 23 Dec 2008 22:03:25 -0800 (PST) Message-ID: Date: Wed, 24 Dec 2008 11:33:25 +0530 From: amar.sannaik@gmail.com To: java-user@lucene.apache.org Subject: Re: Lucene search problem In-Reply-To: <359a92830812230635x6b1ea9bdi855bf4c7bc3e3c50@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_74617_18882893.1230098605846" References: <359a92830812220558u48cb90eci9b731ee7b79e691@mail.gmail.com> <50984.86344.qm@web50711.mail.re2.yahoo.com> <359a92830812230635x6b1ea9bdi855bf4c7bc3e3c50@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_74617_18882893.1230098605846 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hi Erick, I agree lucene do not index the object. in the following example I have quoted fields are indexed as chain.chainName. I am able to retrieve recipe objects using FullTextQuery as "chain.chainName:something' ... question is in somecase chain itself is null. I can be able to achieve required as below: class Recipe { @DocumentId Integer id; @IndexedEmbedded Chain chain = new Chain(); //gettter and setter } class Chain { @DocumentId Integer id; @Field(index = Index.TOKENIZED, name="chainName") String name = "NULLNULNUL"; //getter and setter } so this means to always there is will be chain along with Recipe object with has default name to "NULLNULNUL" and that wil be indexed.. We dont want to do that, Recipe is our persistence object and we hate to do that. -Amar On Tue, Dec 23, 2008 at 8:05 PM, Erick Erickson wrote: > How do you intend to index these? Lucene will not > index objects for you. You have to break the object > down into a series of fields. At that point you can > substitute whatever you want. > > Best > Erick > > On Tue, Dec 23, 2008 at 3:36 AM, wrote: > > > Hi Aaron Schon/EricK, > > > > That really make sense to me but it really seems easy if is the string > > object. See the object structure I have it below hopefully that gives you > > some idea > > > > class Recipe { > > @DocumentId > > Integer id; > > @IndexedEmbedded > > Chain chain; > > //gettter and setter > > } > > > > class Chain { > > @DocumentId > > Integer id; > > @Field(index = Index.TOKENIZED, name="chainName") > > String name; > > //getter and setter > > } > > > > I am creating index on the recipe object. and for some recipe.m_chain > would > > be null. So can you tell me how do I assign the value "NULLNULNULLNULL" > for > > object chain in recipe. > > > > I also was thinking if #FieldBridge help me this way. My plan was to have > > default value where chain is null as you mentioned. but it does not seems > > to > > work for null values. > > > > Please suggest > > > > Thanks in advance. > > -Amar > > > > On Tue, Dec 23, 2008 at 12:04 AM, Aaron Schon > > wrote: > > > > > I would second Erick's recommendation - create an arbitrary > > representation > > > for NULL such as "NULL" (if you are certain the term "NULL" does not > > occur > > > in actual docs. Alternatively, use "NULLNULNULLNULL" or something to > that > > > effect. > > > > > > > > > > > > ----- Original Message ---- > > > From: Erick Erickson > > > To: java-user@lucene.apache.org > > > Sent: Monday, December 22, 2008 8:58:21 AM > > > Subject: Re: Lucene search problem > > > > > > Try searching the mailing list archives for a fuller discussion, but > > > the short answer is usually to index an unique value for your > > > "null" entries, then search on that, something totally > > > outrageous like, say AAABBBCCCDDDEEEFFF. > > > > > > Alternatively, you could create, at startup time, a > > > Filter of all the docs that *do* contain terms for the > > > field in question, flip the bits and use the Filter in your > > > searches. (Hint: see TermDocs/TermEnum) > > > > > > Best > > > Erick > > > > > > On Mon, Dec 22, 2008 at 8:11 AM, wrote: > > > > > > > Hi, > > > > > > > > I have problem with lucene search, I am quite new to this. Can some > > body > > > > help or just push me to who can please. > > > > > > > > Problem what I am facing we need search for object whose attribute > > > "chain" > > > > contaning null, but lucene does not help indexing the null values.. > > > > > > > > how can I achieve this, or please guide me the alternative way of > doing > > > > this. > > > > > > > > Thanks in advance. > > > > -Amar > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > > > > -- > > Amar Sannaik | Programmer | ATHARVA LIBSON Software Pvt Ltd., > > # 9886476270, amarsannaik@atharvalibson.com > > > -- Amar Sannaik | Programmer | ATHARVA LIBSON Software Pvt Ltd., # 9886476270, amarsannaik@atharvalibson.com ------=_Part_74617_18882893.1230098605846--