Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 88501 invoked from network); 20 Jun 2009 16:48:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jun 2009 16:48:19 -0000 Received: (qmail 19676 invoked by uid 500); 20 Jun 2009 16:48:29 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 19585 invoked by uid 500); 20 Jun 2009 16:48:29 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 19577 invoked by uid 99); 20 Jun 2009 16:48:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 16:48:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 16:48:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5F63B234C004 for ; Sat, 20 Jun 2009 09:48:07 -0700 (PDT) Message-ID: <1072297801.1245516487376.JavaMail.jira@brutus> Date: Sat, 20 Jun 2009 09:48:07 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-1701) Add NumericField and NumericSortField, make plain text numeric parsers public in FieldCache, move trie parsers to FieldCache In-Reply-To: <1639192317.1245418147816.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-1701: ---------------------------------- Attachment: LUCENE-1701.patch Patch with all changes, including LUCENE-1687 (it is easier to do this together): - Add NumericField, change JavaDocs to prefer this where possible. - Change range tests to use NumericField during build of test index, this also tests stored fields with NumericField (much cleaner now) - Remove SortField factory from NumericUtils, this class is now almost only for expert users; creating a SortField is possible with SortField ctor using parser instance. - Make all parsers in FieldCache public (DEFAULT_XXX_PARSER) - Add trie parsers to FieldCache, too (NUMERIC_UTILS_XXX_PARSER) - Hide StopFillCacheException-hack - Change SortField to automatically initialize the correct parser according to the type (defaults to text-only parsers) -- there is still some good javadocs missing to tell the user, that it is better to use SortField(String, Parser) instead of SortField(String, type-int) for numeric values, especially when indexed using NumericField. - Because SortField is serializable, all parsers were made singletons and serializable, too (superinterface Parser extends Serializable, default parsers define readResolve() to enforce singletons, which are important for FieldCache to work correctly) - Remove now unneeded (parser==null) checks in sorting code, as SortField enforces a non-null parser now. - Remove all code from ExtendedFieldCache and move to FieldCache (see LUCENE-1687), keep a stub for binary backwards-compatibility. The only implementation is now FieldCacheImpl referred to by DEFAULT (and EXT_DEFAULT for bw). A short note: SortField is only serializable, if all custom comparators used are also serializable, maybe we should also note this in the docs. Parsers are automatically serializable (because superinterface), but not automatically real singletons (but this is not Lucenes problem). > Add NumericField and NumericSortField, make plain text numeric parsers public in FieldCache, move trie parsers to FieldCache > ---------------------------------------------------------------------------------------------------------------------------- > > Key: LUCENE-1701 > URL: https://issues.apache.org/jira/browse/LUCENE-1701 > Project: Lucene - Java > Issue Type: New Feature > Components: Index, Search > Affects Versions: 2.9 > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: 2.9 > > Attachments: LUCENE-1701.patch, NumericField.java > > > In discussions about LUCENE-1673, Mike & me wanted to add a new NumericField to o.a.l.document specific for easy indexing. An alternative would be to add a NumericUtils.newXxxField() factory, that creates a preconfigured Field instance with norms and tf off, optionally a stored text (LUCENE-1699) and the TokenStream already initialized. On the other hand NumericUtils.newXxxSortField could be moved to NumericSortField. > I and Yonik tend to use the factory for both, Mike tends to create the new classes. > Also the parsers for string-formatted numerics are not public in FieldCache. As the new SortField API (LUCENE-1478) makes it possible to support a parser in SortField instantiation, it would be good to have the static parsers in FieldCache public available. SortField would init its member variable to them (instead of NULL), so making code a lot easier (FieldComparator has this ugly null checks when retrieving values from the cache). > Moving the Trie parsers also as static instances into FieldCache would make the code cleaner and we would be able to hide the "hack" StopFillCacheException by making it private to FieldCache (currently its public because NumericUtils is in o.a.l.util). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org