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 320B5EFD6 for ; Tue, 19 Feb 2013 22:19:58 +0000 (UTC) Received: (qmail 37706 invoked by uid 500); 19 Feb 2013 22:19:55 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 37634 invoked by uid 500); 19 Feb 2013 22:19:55 -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 37624 invoked by uid 99); 19 Feb 2013 22:19:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 22:19:55 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLYTO_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul_t100@fastmail.fm designates 66.111.4.25 as permitted sender) Received: from [66.111.4.25] (HELO out1-smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 22:19:48 +0000 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id B80F32094F for ; Tue, 19 Feb 2013 17:19:27 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 19 Feb 2013 17:19:27 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= message-id:date:from:reply-to:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=QLohiBFQBTQvlVzIRv6Zog7qy9I=; b=dIL+Cj4BQBiPD1YxP3kYTd87IG1H 2ZIKfIEp2TiDBbfZh/p4xl8lDfQFcp6MhTRVQXmTdlwbuOT31shKn5q0XvFO7Epw dQtGJIbP5UYIal8ClKhPMZk0F2nHdnCA9NwqrnfASPNhdzgZX+ZLzKjm9KRGYCRD QttzIG8YHFGJnew= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:reply-to :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=QLohiBFQBTQvlVzIRv6Zog 7qy9I=; b=P5emHBRmUjctH6TyJSmHEEodISD58fWwRnsUaC5Mcube181fyfKfj1 l0g6kYOJ/lQk5zbaWXSBOJh/hNx0/2kn8nMvSUcB3IANhgsAlI56/Da+ciGRFY6V 5l1QNMuQ77XEHR9rJ8EVoatYGaGqGQhDX04DhYY2O1GFOq6GrsQ5U= X-Sasl-enc: C0nb+J4epcgdRVza5s85Xql4xOcd+enrcQwTtTL/mvFp 1361312367 Received: from [192.168.1.66] (unknown [217.155.98.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 3A5A68E099F for ; Tue, 19 Feb 2013 17:19:27 -0500 (EST) Message-ID: <5123FA6D.5050100@fastmail.fm> Date: Tue, 19 Feb 2013 22:19:25 +0000 From: Paul Taylor Reply-To: paul_t100@fastmail.fm User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Field seems to have become binary field on update to Lucene 4.1 References: <5123E704.5060900@fastmail.fm> In-Reply-To: <5123E704.5060900@fastmail.fm> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 19/02/2013 20:56, Paul Taylor wrote: > > Strange test failure after converting code from Lucene 3.6 to Lucene 4.1 > > public void testIndexPuid() throws Exception { > > addReleaseOne(); > RAMDirectory ramDir = new RAMDirectory(); > createIndex(ramDir); > > IndexReader ir = IndexReader.open(ramDir); > Fields fields = MultiFields.getFields(ir); > Terms terms = fields.terms("puid"); > TermsEnum termsEnum = terms.iterator(null); > termsEnum.next(); > assertEquals("efd2ace2-b3b9-305f-8a53-9803595c0e38", > termsEnum.term()); > } > > returns: > > Expected :efd2ace2-b3b9-305f-8a53-9803595c0e38 > Actual :[65 66 64 32 61 63 65 32 2d 62 33 62 39 2d 33 30 35 66 2d 38 > 61 35 33 2d 39 38 30 33 35 39 35 63 30 65 33 38] > > It seems to be adding the field as a binary field rather than a text > field, but I checked and the field is being added using the deprecated > > new Field("puid", value, Field.Index.NOT_ANALYZED_NO_NORMS, new > KeywordAnalyzer()) > > so shouldn't that work the same way as before ? > > > Doh, my bad missing utf8ToString() assertEquals("efd2ace2-b3b9-305f-8a53-9803595c0e38", termsEnum.term().utf8ToString()); Paul --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org