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 B80BCFC7D for ; Sun, 14 Apr 2013 21:49:09 +0000 (UTC) Received: (qmail 70962 invoked by uid 500); 14 Apr 2013 21:49:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 70913 invoked by uid 500); 14 Apr 2013 21:49:07 -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 70905 invoked by uid 99); 14 Apr 2013 21:49:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Apr 2013 21:49:07 +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 (athena.apache.org: domain of welshwang@gmail.com designates 209.85.212.50 as permitted sender) Received: from [209.85.212.50] (HELO mail-vb0-f50.google.com) (209.85.212.50) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Apr 2013 21:49:03 +0000 Received: by mail-vb0-f50.google.com with SMTP id w15so3293071vbb.23 for ; Sun, 14 Apr 2013 14:48:42 -0700 (PDT) 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=+G5boKrBubfkXdr3U2+qSmnf6TKB/7IpzF0zZ4cCEgA=; b=bNTVryNR9oNOh4bzcJKbLXeg6UV0cr0LYmZFv6N0+iNpUkP0Yi4ABoD3BJcOpPvxty 2C9bize6FUMTqsaBqYQlGpLmrOFKzHUNcpHp6683KojmZdeRO0u3Zy0EacZn7pwpOBcV tx1thPPoImm97lErvEQFA7cPU1x/Lg1621IXw6V7Fo0ZMJT4Gk5nVXKMcYXUah/cK7/g UBTDB68j1qkv5E1MX3HDroySHhmSyhjQJTEg3g1HfNaGQse5781F37OMgumcMu2q/UMz 6hLQFgj0DZzHonJpOkwviYM5xwMBZX7H+OcPIyRUgZWtwVH7esEyQCVOlMbK7iJ3o6oS FN9A== MIME-Version: 1.0 X-Received: by 10.220.156.75 with SMTP id v11mr14435197vcw.1.1365976122494; Sun, 14 Apr 2013 14:48:42 -0700 (PDT) Received: by 10.52.28.71 with HTTP; Sun, 14 Apr 2013 14:48:42 -0700 (PDT) In-Reply-To: <016101ce3958$c157dff0$44079fd0$@thetaphi.de> References: <016101ce3958$c157dff0$44079fd0$@thetaphi.de> Date: Sun, 14 Apr 2013 14:48:42 -0700 Message-ID: Subject: Re: DiskDocValuesFormat From: Wei Wang To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=f46d043c7c868d953004da591959 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c7c868d953004da591959 Content-Type: text/plain; charset=ISO-8859-1 Yes, I used Maven Shade plugin, but still have this problem. Here is the Maven output during packaging: [INFO] --- maven-shade-plugin:2.0:shade (default) @ audience-profile-indexer --- [INFO] Including commons-collections:commons-collections:jar:3.2.1 in the shaded jar. [INFO] Including org.mockito:mockito-core:jar:1.9.5 in the shaded jar. [INFO] Including org.hamcrest:hamcrest-core:jar:1.1 in the shaded jar. [INFO] Including org.objenesis:objenesis:jar:1.0 in the shaded jar. [INFO] Including junit:junit:jar:4.11 in the shaded jar. [INFO] Including log4j:log4j:jar:1.2.17 in the shaded jar. [INFO] Including org.apache.lucene:lucene-core:jar:4.2.1 in the shaded jar. [INFO] Including org.apache.lucene:lucene-queries:jar:4.2.1 in the shaded jar. [INFO] Including org.apache.lucene:lucene-queryparser:jar:4.2.1 in the shaded jar. [INFO] Including org.apache.lucene:lucene-sandbox:jar:4.2.1 in the shaded jar. [INFO] Including jakarta-regexp:jakarta-regexp:jar:1.4 in the shaded jar. [INFO] Including org.apache.lucene:lucene-analyzers-common:jar:4.2.1 in the shaded jar. [INFO] Including org.apache.lucene:lucene-codecs:jar:4.2.1 in the shaded jar. [INFO] Including commons-lang:commons-lang:jar:2.6 in the shaded jar. [INFO] Including commons-logging:commons-logging:jar:1.1.1 in the shaded jar. [INFO] Including commons-io:commons-io:jar:2.4 in the shaded jar. [INFO] Replacing original artifact with shaded artifact. On Sun, Apr 14, 2013 at 2:40 PM, Uwe Schindler wrote: > If you create a single JAR file out of multiple Lucene JAR files use a > tool like Maven Shade plugin, otherwise, required metadata propreties > (META-INF/services) files in the JAR files are not correctly merged > together. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > > > > -----Original Message----- > > From: Wei Wang [mailto:welshwang@gmail.com] > > Sent: Sunday, April 14, 2013 11:30 PM > > To: java-user@lucene.apache.org > > Subject: Re: DiskDocValuesFormat > > > > Hi Adrien, > > > > The Lucene42Codec works well to generate the index with > > DiskDocValuesFormat. But when I tried to merge the index segments by > > calling: > > > > IndexWriter iw = new IndexWriter(directory, iw_config); ... > > iw.forceMerge(1); > > > > I got the following error message: > > > > Caused by: java.lang.IllegalArgumentException: A SPI class of type > > org.apache.lucene.codecs.DocValuesFormat with name 'Disk' does not exist. > > You need to add the corresponding JAR file supporting this SPI to your > > classpath.The current classpath supports the following names: [Lucene42] > > > > Any hint on this classpath problem? I have created a single jar file > that has all > > necessary dependencies, such as lucene-codecs-4.2.0.jar. And I assume the > > indexing step works well, so Lucene already knows the format with name > > 'Disk'. > > > > Thanks. > > > > On Sat, Apr 13, 2013 at 4:25 AM, Adrien Grand wrote: > > > > > Hi Wei, > > > > > > On Sat, Apr 13, 2013 at 7:44 AM, Wei Wang > > wrote: > > > > I am trying to use DiskDocValuesFormat for a particular > > > > BinaryDocValuesField. It seems there is no good examples showing how > > > > to > > > do > > > > this. The only hint I got from various docs and forums is set some > > > > codec > > > in > > > > IndexWriter. Could someone give a few lines of code snippet and show > > > > how > > > to > > > > set DiskDocValuesFormat? > > > > > > Lucene42Codec can be extended to specify the doc values format to use > > > on a per-field basis. For example: > > > > > > final Codec codec = new Lucene42Codec() { > > > final Lucene42DocValuesFormat memoryDVFormat = new > > > Lucene42DocValuesFormat(); > > > final DiskDocValuesFormat diskDVFormat = new DiskDocValuesFormat(); > > > @Override > > > public DocValuesFormat getDocValuesFormatForField(String field) { > > > if ("dv_mem".equals(field)) { > > > // use Lucene42 for "dv_mem" > > > return memoryDVFormat; > > > } else { > > > // use Disk otherwise > > > return diskDVFormat; > > > } > > > } > > > }; > > > > > > Then just pass this Codec instance to your IndexWriterConfig. > > > > > > -- > > > Adrien > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --f46d043c7c868d953004da591959--