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 5C0FE17A23 for ; Tue, 27 Oct 2015 20:18:11 +0000 (UTC) Received: (qmail 14246 invoked by uid 500); 27 Oct 2015 20:17:11 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 14188 invoked by uid 500); 27 Oct 2015 20:17:11 -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 14174 invoked by uid 99); 27 Oct 2015 20:17:11 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2015 20:17:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C2F0AC0FCB for ; Tue, 27 Oct 2015 20:17:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id sjoe6rS9-n4Q for ; Tue, 27 Oct 2015 20:17:04 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id BCC7544480 for ; Tue, 27 Oct 2015 20:17:03 +0000 (UTC) Received: by igbkq10 with SMTP id kq10so103527087igb.0 for ; Tue, 27 Oct 2015 13:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nIyvJqRLua+Edy6tfW2G4DYSBLaiOcvLMuuKqV4/j/M=; b=ZS88BjQY9jyKy4xXBy7QCMQO7jbvJGgRVd93VMZwmHk1vCAnw2oHd0D+GgRA+FA353 ENqrZ4nEPROePNCEaqnezeCe4uJUYN1Xdtclo9OkxupCrZYM6qJh+2CwR+KwL1JhibWH YxepWi+h0OoZ8WS+NKG4Wo4SPxU3wshpChALAoZoo5fjBbGrkOYRvj/gnYYI8HZCa0i7 IAML30x0yW/Zo58de+wkzykE9FXA5UuaVxD6kAHfdf9NvBmcIDc19CFv5VzyqwWwO1n2 C44IfXgGa+TKHGhy7h0sDkUxBVD1Yi7Cl/TsWSmAwvrYPpxZvOerT+e9kkePC/aKEVY6 xEBQ== MIME-Version: 1.0 X-Received: by 10.50.47.70 with SMTP id b6mr12825480ign.57.1445977023286; Tue, 27 Oct 2015 13:17:03 -0700 (PDT) Received: by 10.107.31.69 with HTTP; Tue, 27 Oct 2015 13:17:03 -0700 (PDT) In-Reply-To: References: <562F8112.3050603@gmail.com> Date: Tue, 27 Oct 2015 13:17:03 -0700 Message-ID: Subject: Re: Two different types of values in same field name in single index From: Erick Erickson To: java-user Content-Type: text/plain; charset=UTF-8 I would be pretty skeptical of this approach You're mixing numeric data with textual data and I expect the results to be unpredictable. You already said "it is working for most of the documents except one or two documents." I predict you'll find more and more of these as time passes. Expect many more anomalies. At best you need to index both forms as text rather than mixing numeric and text data. Since you're not sorting you should be OK with the caveat that searching for "02" won't match an indexed value of "2" unless you remove all leading zeros at both index and query time. Best, Erick On Tue, Oct 27, 2015 at 11:31 AM, Kumaran Ramasubramanian wrote: > Yes Will, You are right. But i dont use "status" field for sorting. i have > other fields that is being used for sorting specifically. And so i dont > face any issues in sorting as of now. > > -- > Kumaran R > > > On Tue, Oct 27, 2015 at 7:20 PM, will wrote: > >> Kumaran - >> >> Aren't you creating an unworkable scenario for sorting? >> >> -will >> >> On 10/27/15 5:49 AM, Kumaran Ramasubramanian wrote: >> >>> Hi All, >>> >>> i have indexed module wise data in same index. In this case, we index >>> two >>> types of field in same name in two different document like this. >>> >>> *document1:* >>> >>> module:1 >>>> status:4 ( as LongField ) >>>> >>>> *code:* >>> >>> long longValue=Long.parseLong(value); >>>> LongField field=new LongField(f >>>> ield >>>> Name,longValue, Field.Store.YES); >>>> document.add(field); >>>> >>>> >>> *document2:* >>> >>> module:2 >>>> status:open ( as Field ) >>>> >>> *code:* >>> >>> >>>> Field field = new Field( >>>> f >>>> >>>> ield >>>> Name, value, (Field.Store) stored, (Field.Index) indexType); >>>> >>> document.add(field); >>> >>> >>> >>>> >>>> There are around 50lakh documents in my index which has these kind of >>> mixed >>> type of fields >>> >>> when i query like status:4 or status:open, it is working for most of the >>> documents except one or two documents. >>> >>> Not able to reproduce the same in other indexes. So i want confirm whether >>> it is supported to have both Field & LongField with same field name in >>> same >>> index. And also Please suggest me any articles discussing this kind of >>> problem. >>> >>> Thanks :-) >>> >>> Related links: >>> http://www.gossamer-threads.com/lists/lucene/java-user/109530 >>> >>> -- >>> ** >>> Kumaran R >>> >>> >> --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org