Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFDB011A81 for ; Tue, 6 May 2014 20:32:32 +0000 (UTC) Received: (qmail 39355 invoked by uid 500); 6 May 2014 18:26:56 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 39304 invoked by uid 500); 6 May 2014 18:26:55 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 39291 invoked by uid 99); 6 May 2014 18:26:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2014 18:26:55 +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 (nike.apache.org: domain of david.w.smiley@gmail.com designates 209.85.213.43 as permitted sender) Received: from [209.85.213.43] (HELO mail-yh0-f43.google.com) (209.85.213.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2014 18:26:50 +0000 Received: by mail-yh0-f43.google.com with SMTP id f10so1036862yha.2 for ; Tue, 06 May 2014 11:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=+dm7I2pT5bAz3lNDkGyEvT78gHHkMBhJHjAupt5k7iM=; b=HzdKuEHbVF5B63aqJ6Qp0jKdL/o6nzCyOaOTg3ClbGcZk0pEhdQ//Ia3EcEz3nZRg3 fhKjf3djJf7wc3fcHGTZfdZZhQjzRsgNW8diOFLxtmtiBBoHCNCNCW6IdX3jSHvPP9Ys dED00+G8brd7q5VvcLKp9OgwpJ8Itmq3YPQY+Y2O6Y+G0PI3tq4DwevrPP9b58S6Q8uM qbpxhsIHogxQaAMx7Y25lTzgmz/sjcbirkmpGxRChvwkoqwWYU3oArugJQ+4u/qrqRLM Ex4Gev4gmOANRT0OBBhMhA0T90pFJHkiV/xxG1CccailwJHBqOIjghU3Kfk9n0SXKKaG 8QsA== MIME-Version: 1.0 X-Received: by 10.236.183.67 with SMTP id p43mr60598533yhm.115.1399400786637; Tue, 06 May 2014 11:26:26 -0700 (PDT) Received: by 10.170.50.82 with HTTP; Tue, 6 May 2014 11:26:26 -0700 (PDT) In-Reply-To: <53689BCE.4050206@helsinki.fi> References: <53689BCE.4050206@helsinki.fi> Date: Tue, 6 May 2014 14:26:26 -0400 Message-ID: Subject: Re: range types in SOLR From: "david.w.smiley@gmail.com" To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=bcaec52c5eadc9384704f8bf6201 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec52c5eadc9384704f8bf6201 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Era, I appreciate the scattered documentation is confusing for users. The use of spatial for time durations is definitely not an official way to do it; it=E2=80=99s clearly a hack/trick =E2=80=94 one that works pretty well if y= ou know the issues to watch out for. So I don=E2=80=99t see it getting documented on t= he reference guide. But, you should be happy to know about this: https://issues.apache.org/jira/browse/LUCENE-5648 =E2=80=9CWatch=E2=80=9D = that issue to stay abreast of my development on it, and the inevitable Solr FieldType to follow, and inevitable documentation in the reference guide. With luck it=E2=80=99ll get in by 4.9. The =E2=80=9CIntersects(POLYGON(=E2=80=A6))=E2=80=9D syntax is something I = suggest using when you have to =E2=80=94 like when you have a polygon or linestring or if you are = indexing circles. One of these days there will be a more Solr friendly query parser =E2=80=94 definitely for 4.something. When that happens, it=E2=80=99ll get deprecated/removed in trunk/5. ~ David On Tue, May 6, 2014 at 4:22 AM, Ere Maijala wrote= : > David, > > I made a note about your mentioning the deprecation below to take it into > account in our software, but now that I tried to find out more about this= I > ran into some confusion since the Solr documentation regarding spatial > searches is currently quite badly scattered and partly obsolete [1]. I'd > appreciate some clarification on what exactly is deprecated. We're > currently using spatial for both time duration and geographic searches, a= nd > in the latter we also use e.g. Intersects(POLYGON(...)) in addition. Is > this also deprecated and if so, how should I rewrite it? Thanks! > > --Ere > > [1] It would be really nice if it was possible to find up to date > documentation of at least all this in one place: > > https://cwiki.apache.org/confluence/display/solr/Spatial+Search > https://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4 > http://wiki.apache.org/solr/SpatialForTimeDurations > https://people.apache.org/~hossman/spatial-for-non- > spatial-meetup-20130117/ > http://mail-archives.apache.org/mod_mbox/lucene-solr-user/ > 201212.mbox/%3C1355027722156-4025434.post@n3.nabble.com%3E > > 3.3.2014 20.12, Smiley, David W. kirjoitti: > >> The main reference for this approach is here: >> http://wiki.apache.org/solr/SpatialForTimeDurations >> >> >> Hoss=E2=80=99s illustrations he developed for the meetup presentation ar= e great. >> However, there are bugs in the instruction =E2=80=94 specifically it=E2= =80=99s important >> to slightly buffer the query and choose an appropriate maxDistErr. Also= , >> it=E2=80=99s more preferable to use the rectangle range query style of s= patial >> query (e.g. field:[=E2=80=9CminX minY=E2=80=9D TO =E2=80=9CmaxX maxY=E2= =80=9D] as opposed to using >> =E2=80=9CIntersects(minX minY maxX maxY)=E2=80=9D. There=E2=80=99s no t= echnical difference but >> the latter is deprecated and will eventually be removed from Solr 5 / >> trunk. >> >> All this said, recognize this is a bit of a hack (one that works well). >> There is a good chance a more ideal implementation approach is going to = be >> developed this year. >> >> ~ David >> >> >> On 3/1/14, 2:54 PM, "Shawn Heisey" wrote: >> >> On 3/1/2014 11:41 AM, Thomas Scheffler wrote: >>> >>>> Am 01.03.14 18:24, schrieb Erick Erickson: >>>> >>>>> I'm not clear what you're really after here. >>>>> >>>>> Solr certainly supports ranges, things like time:[* TO date_spec] or >>>>> date_field:[date_spec TO date_spec] etc. >>>>> >>>>> >>>>> There's also a really creative use of spatial (of all things) to, say >>>>> answer questions involving multiple dates per record. Imagine, for >>>>> instance, employees with different hours on different days. You can >>>>> use spatial to answer questions like "which employees are available >>>>> on Wednesday between 4PM and 8PM". >>>>> >>>>> And if none of this is relevant, how about you give us some >>>>> use-cases? This could well be an XY problem. >>>>> >>>> >>>> Hi, >>>> >>>> lets try this example to show the problem. You have some old text that >>>> was written in two periods of time: >>>> >>>> 1.) 2nd half of 13th century: -> 1250-1299 >>>> 2.) Beginning of 18th century: -> 1700-1715 >>>> >>>> You are searching for text that were written between 1300-1699, than >>>> this document described above should not be hit. >>>> >>>> If you make start date and end date multiple this results in: >>>> >>>> start: [1250, 1700] >>>> end: [1299, 1715] >>>> >>>> A search for documents written between 1300-1699 would be: >>>> >>>> (+start:[1300 TO 1699] +end:[1300-1699]) (+start:[* TO 1300] +end:[130= 0 >>>> TO *]) (+start:[*-1699] +end:[1700 TO *]) >>>> >>>> You see that the document above would obviously hit by "(+start:[* TO >>>> 1300] +end:[1300 TO *])" >>>> >>> >>> This sounds exactly like the spatial use case that Erick just described= . >>> >>> http://wiki.apache.org/solr/SpatialForTimeDurations >>> https://people.apache.org/~hossman/spatial-for-non- >>> spatial-meetup-20130117 >>> / >>> >>> I am not sure whether the following presentation covers time series wit= h >>> spatial, but it does say deep dive. It's over an hour long, and done b= y >>> David Smiley, who wrote most of the Spatial code in Solr: >>> >>> http://www.lucenerevolution.org/2013/Lucene-Solr4-Spatial-Deep-Dive >>> >>> Hopefully someone who has actually used this can hop in and give you >>> some additional pointers. >>> >>> Thanks, >>> Shawn >>> >>> >> > > -- > Ere Maijala > Kansalliskirjasto / The National Library of Finland > --bcaec52c5eadc9384704f8bf6201--