Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@minotaur.apache.org Received: (qmail 35572 invoked from network); 22 Jan 2010 01:43:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jan 2010 01:43:16 -0000 Received: (qmail 91384 invoked by uid 500); 22 Jan 2010 01:43:15 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 91306 invoked by uid 500); 22 Jan 2010 01:43:15 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 91295 invoked by uid 99); 22 Jan 2010 01:43:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2010 01:43:15 +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; Fri, 22 Jan 2010 01:43:14 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6DE1F234C4A7 for ; Thu, 21 Jan 2010 17:42:54 -0800 (PST) Message-ID: <482518882.408371264124574448.JavaMail.jira@brutus.apache.org> Date: Fri, 22 Jan 2010 01:42:54 +0000 (UTC) From: "Lance Norskog (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Commented: (SOLR-1729) Date Facet now override time parameter In-Reply-To: <108504655.397501264090914437.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803568#action_12803568 ] Lance Norskog commented on SOLR-1729: ------------------------------------- This is a wider-ranging problem than just date facets. If I am indexing data to several cores I might want to override the NOW tiime for each core. Or a distributed search that uses (NOW/HOUR). And then there's logging. > Date Facet now override time parameter > -------------------------------------- > > Key: SOLR-1729 > URL: https://issues.apache.org/jira/browse/SOLR-1729 > Project: Solr > Issue Type: Improvement > Components: search > Affects Versions: 1.4 > Environment: Solr 1.4 > Reporter: Peter Sturge > Priority: Minor > Attachments: FacetParams.java, SimpleFacets.java > > > This PATCH introduces a new query parameter that tells a (typically, but not necessarily) remote server what time to use as 'NOW' when calculating date facets for a query (and, for the moment, date facets *only*) - overriding the default behaviour of using the local server's current time. > This gets 'round a problem whereby an explicit time range is specified in a query (e.g. timestamp:[then0 TO then1]), and date facets are required for the given time range (in fact, any explicit time range). > Because DateMathParser performs all its calculations from 'NOW', remote callers have to work out how long ago 'then0' and 'then1' are from 'now', and use the relative-to-now values in the facet.date.xxx parameters. If a remote server has a different opinion of NOW compared to the caller, the results will be skewed (e.g. they are in a different time-zone, not time-synced etc.). > This becomes particularly salient when performing distributed date faceting (see SOLR-1709), where multiple shards may all be running with different times, and the faceting needs to be aligned. > The new parameter is called 'facet.date.now', and takes as a parameter a (stringified) long that is the number of milliseconds from the epoch (1 Jan 1970 00:00) - i.e. the returned value from a System.currentTimeMillis() call. This was chosen over a formatted date to delineate it from a 'searchable' time and to avoid superfluous date parsing. This makes the value generally a programatically-set value, but as that is where the use-case is for this type of parameter, this should be ok. > NOTE: This parameter affects date facet timing only. If there are other areas of a query that rely on 'NOW', these will not interpret this value. This is a broader issue about setting a 'query-global' NOW that all parts of query analysis can share. > Source files affected: > FacetParams.java (holds the new constant FACET_DATE_NOW) > SimpleFacets.java getFacetDateCounts() NOW parameter modified > This PATCH is mildly related to SOLR-1709 (Distributed Date Faceting), but as it's a general change for date faceting, it was deemed deserving of its own patch. I will be updating SOLR-1709 in due course to include the use of this new parameter, after some rfc acceptance. > A possible enhancement to this is to detect facet.date fields, look for and match these fields in queries (if they exist), and potentially determine automatically the required time skew, if any. There are a whole host of reasons why this could be problematic to implement, so an explicit facet.date.now parameter is the safest route. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.