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 32DA817BE7 for ; Tue, 8 Sep 2015 14:53:05 +0000 (UTC) Received: (qmail 50897 invoked by uid 500); 8 Sep 2015 14:53:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 50841 invoked by uid 500); 8 Sep 2015 14:53:03 -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 Delivered-To: moderator for java-user@lucene.apache.org Received: (qmail 93854 invoked by uid 99); 8 Sep 2015 14:35:17 -0000 X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.898 X-Spam-Level: ** X-Spam-Status: No, score=2.898 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=2p6uUWtVHySDDAvIdSnYeLmhupAR7MWh61wMUAhy0u4=; b=ulfsTI2kBjWwkM5DwBHE4VEhgOtsV7igOPLny1/A7L/PLGIAtoSu0o6fyRcQehLVvW iOOI9eFlfst9vXFXk21P8vj/f6DYeineagxpAnwinnZwt/P9I1T65kRZkHv9tBKIOp5W uOGFqf14OGNJaa+/VeMVoOX69EtQ7l2JXBnMjQgWRR/wl6m9MmDmBYdGLNiiAC5gWsac TCSl/5d/OAi2iZzApXBiNjecZuC+cqlZbqn2Q+a8Kgpja82zU/S3JRsitmHA9/Pwl1kN /pwq7/3ZjcRfdGT/lvB4VceYUeG93xx1Q/ghHo3xaxcXfg3x483dDe+CBeZGhaSQmslI 3T2Q== MIME-Version: 1.0 X-Received: by 10.140.234.202 with SMTP id f193mr9196727qhc.69.1441722909406; Tue, 08 Sep 2015 07:35:09 -0700 (PDT) Date: Tue, 8 Sep 2015 17:35:09 +0300 Message-ID: Subject: Problems with toString at TermsQuery From: Ruslan Muzhikov To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a1135d764e13c8a051f3d45aa --001a1135d764e13c8a051f3d45aa Content-Type: text/plain; charset=UTF-8 Hi! Sometimes TermsQuery.toString() method falls with exception: *Exception in thread "main" java.lang.AssertionError* * at org.apache.lucene.util.UnicodeUtil.UTF8toUTF16(UnicodeUtil.java:546)* * at org.apache.lucene.util.BytesRef.utf8ToString(BytesRef.java:149)* * at org.apache.lucene.queries.TermsQuery.toString(TermsQuery.java:190)* * at org.apache.lucene.search.Query.toString(Query.java:67)* * ...* Here is the example of such program: *public static void main(String[] args) {* * System.out.print(new TermsQuery(new Term("DATA", new BytesRef(toBytes(128)))).toString());* *}* *public static byte[] toBytes(int val) {* * byte[] b = new byte[4];* * for(int i = 3; i > 0; i--) {* * b[i] = (byte) val;* * val >>>= 8;* * }* * b[0] = (byte) val;* * return b;* *}* Is there any limits on BytesRef content? Thanks, Ruslan Muzhikov --001a1135d764e13c8a051f3d45aa--