From java-user-return-52525-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Fri Apr 6 09:05:33 2012 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 17E239F1A for ; Fri, 6 Apr 2012 09:05:33 +0000 (UTC) Received: (qmail 73117 invoked by uid 500); 6 Apr 2012 09:05:31 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 71942 invoked by uid 500); 6 Apr 2012 09:05:23 -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 93884 invoked by uid 99); 6 Apr 2012 05:55:21 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhaocc@act.buaa.edu.cn designates 219.239.227.113 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=s1024;d=act.buaa.edu.cn; h=message-id:date:from:mime-version:to:subject:content-type; bh=bCYKQiqFWSXgpHTstfMTK384Tyg=; b=ITT11C9nH4crHA9kfvMWPZDYZD4fQq5dFPUcF+uD/fvTkhLQpnAQUOJ4Jo+zpQ97ei4Uw3r/ kxD7JSL3phhZVtSZN7MUEUGE2sZOhNXMWvvTpjrJJnKcANJl85hQ8wGgrp78L9Z8SP7rP9FE TB+K8NdfbL/YgmniTVy8rjvUkkw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024;d=act.buaa.edu.cn; h=message-id:date:from:mime-version:to:subject:content-type; b=ktbqWnFiGdP1h85rR8AZsnlA3MDrHgmbH77qo68t0kpEq+vMgzEeDRnN3CGfXGSt9aEjj80Z OCk400ncuUiAww2OroOlJarbiiNrrNN6dlsfxOvyw+/FcEhpgLRt6Mi4phfsV7Omb20zFrhC yNzYVsUxAIoOjdpJjLu3ERwwaVI= Message-ID: <4F7E852C.5020009@act.buaa.edu.cn> Date: Fri, 6 Apr 2012 13:54:52 +0800 From: Chengcheng Zhao User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Subject: weird multifile problems Content-Type: multipart/mixed; boundary="------------080406010303070305070002" X-Virus-Checked: Checked by ClamAV on apache.org --------------080406010303070305070002 Content-Type: multipart/alternative; boundary="------------050301030407060905060609" --------------050301030407060905060609 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Hi guys, I am still learning Lucene, and I had a very weird problem yesterday that no matter what I did, I always got multifiles not compound file. By default, Lucene use compound file, but I just got this weird problem, even if I used setUseCompoundFile(true) explicitly... And my code is actually adapted from the book Lucene In Action 2ed and the demo code in lucene.apache.org... How can I fix this? --------------050301030407060905060609 Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: 7bit Hi guys,
I am still learning Lucene, and I had a very weird problem yesterday that no matter what I did, I always got multifiles not compound file. By default, Lucene use compound file, but I just got this weird problem, even if I used setUseCompoundFile(true) explicitly... And my code is actually adapted from the book Lucene In Action 2ed and the demo code in lucene.apache.org... How can I fix this?

--------------050301030407060905060609-- --------------080406010303070305070002 Content-Type: text/plain; name="Indexer.java" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Indexer.java" cGFja2FnZSBhY3QuaW5kZXhpbmc7CgppbXBvcnQgb3JnLmFwYWNoZS5sdWNlbmUuYW5hbHlz aXMuQW5hbHl6ZXI7CmltcG9ydCBvcmcuYXBhY2hlLmx1Y2VuZS5hbmFseXNpcy5zdGFuZGFy ZC5TdGFuZGFyZEFuYWx5emVyOwppbXBvcnQgb3JnLmFwYWNoZS5sdWNlbmUuZG9jdW1lbnQu RG9jdW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; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------080406010303070305070002--