Details

    • Type: New Feature New Feature
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: spatial
    • Labels:
      None

      Description

      Given all the work around spatial, it would be beneficial if Solr had a query parser for dealing with spatial queries. For starters, something that used geonames data or maybe even Google Maps API would be really useful. Longer term, a spatial grammar that can robustly handle all the vagaries of addresses, etc. would be really cool.

      Refs:
      [1] http://www.geonames.org/export/client-libraries.html (note the Java client is ASL)
      [2] Data from geo names: http://download.geonames.org/export/dump/

      1. geocodercomponent_initial.patch
        27 kB
        Ishan Chattopadhyaya
      2. schema.xml
        2 kB
        Ishan Chattopadhyaya
      3. solrconfig.xml
        3 kB
        Ishan Chattopadhyaya
      4. Indexer.java
        3 kB
        Ishan Chattopadhyaya

        Issue Links

          Activity

          Hide
          Ishan Chattopadhyaya added a comment -

          Here's an early patch based on the approach discussed in the talk. This is for a geocoding component organized as a SearchComponent.

          It uses per-field, in-memory bloom filters to perform quick query classification into various hierarchical toponyms in the index. It takes in a set of valid geocoding grammar rules (from solrconfig.xml) and for those permutations of classifications that pass the grammar rules, it creates boolean queries and fires against the index.

          I have included a util class Indexer.java to index GeoNames US data into the index.

          The patch needs further work to handle queries containing house numbers etc. Some queries that work:
          http://HOSTNAME:8983/solr/collection1/geocoder?q=pizza%20near%20san%20francisco,%20ca
          http://HOSTNAME:8983/solr/collection1/geocoder?q=california
          http://HOSTNAME:8983/solr/collection1/geocoder?q=redwood+city

          (Please replace HOSTNAME with geocoder.in for a live demo)

          Grant Ingersoll, David Smiley and others, please review. Thanks.

          Show
          Ishan Chattopadhyaya added a comment - Here's an early patch based on the approach discussed in the talk. This is for a geocoding component organized as a SearchComponent. It uses per-field, in-memory bloom filters to perform quick query classification into various hierarchical toponyms in the index. It takes in a set of valid geocoding grammar rules (from solrconfig.xml) and for those permutations of classifications that pass the grammar rules, it creates boolean queries and fires against the index. I have included a util class Indexer.java to index GeoNames US data into the index. The patch needs further work to handle queries containing house numbers etc. Some queries that work: http://HOSTNAME:8983/solr/collection1/geocoder?q=pizza%20near%20san%20francisco,%20ca http://HOSTNAME:8983/solr/collection1/geocoder?q=california http://HOSTNAME:8983/solr/collection1/geocoder?q=redwood+city (Please replace HOSTNAME with geocoder.in for a live demo) Grant Ingersoll , David Smiley and others, please review. Thanks.
          Hide
          David Smiley added a comment -

          Grant Ingersoll had this to say about this issue:

          FWIW, my intent behind SOLR-1578, was a geocoding query parser (i.e. put in addresses, POIs, etc.), not more spatial QP operators. I'm fine w/ marking it as a duplicate, but at least wanted to capture that the issue was trying to achieve something different than what this is.

          The issue title here should be renamed to include "geocoding" – a key intended distinction. I'll rename it and even re-open it. But that said... it's hard to imagine Solr shipping with geocoding unless perhaps it ended up as a contrib module. I saw Ishan Chattopadhyaya's Lucene Revolution presentation on geocoding and it is very non-trivial and requires large data files to resolve against.

          Show
          David Smiley added a comment - Grant Ingersoll had this to say about this issue: FWIW, my intent behind SOLR-1578 , was a geocoding query parser (i.e. put in addresses, POIs, etc.), not more spatial QP operators. I'm fine w/ marking it as a duplicate, but at least wanted to capture that the issue was trying to achieve something different than what this is. The issue title here should be renamed to include "geocoding" – a key intended distinction. I'll rename it and even re-open it. But that said... it's hard to imagine Solr shipping with geocoding unless perhaps it ended up as a contrib module. I saw Ishan Chattopadhyaya 's Lucene Revolution presentation on geocoding and it is very non-trivial and requires large data files to resolve against.
          Hide
          David Smiley added a comment -

          I'm closing this as a duplicate of SOLR-4242. This issue came first but I think there is better context/discussion there.

          Show
          David Smiley added a comment - I'm closing this as a duplicate of SOLR-4242 . This issue came first but I think there is better context/discussion there.
          Hide
          Furkan KAMACI added a comment -

          Hi;

          What are the requirement here? I have read that article: http://www.ibm.com/developerworks/java/library/j-spatial/index.html written by Grant Ingersoll and if we can explain the requirements I can develop a patch for this issue.

          Show
          Furkan KAMACI added a comment - Hi; What are the requirement here? I have read that article: http://www.ibm.com/developerworks/java/library/j-spatial/index.html written by Grant Ingersoll and if we can explain the requirements I can develop a patch for this issue.
          Hide
          Robert Muir added a comment -

          3.4 -> 3.5

          Show
          Robert Muir added a comment - 3.4 -> 3.5
          Hide
          Robert Muir added a comment -

          Bulk move 3.2 -> 3.3

          Show
          Robert Muir added a comment - Bulk move 3.2 -> 3.3
          Hide
          Hoss Man added a comment -

          Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email...

          http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

          Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed.

          A unique token for finding these 240 issues in the future: hossversioncleanup20100527

          Show
          Hoss Man added a comment - Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed. A unique token for finding these 240 issues in the future: hossversioncleanup20100527
          Hide
          Jason Rutherglen added a comment -

          GBase http://code.google.com/apis/base/docs/2.0/query-lang-spec.html (Locations section at the bottom of the page) has a query syntax for spatial queries (i.e. @+40.75-074.00 + 5mi)

          Show
          Jason Rutherglen added a comment - GBase http://code.google.com/apis/base/docs/2.0/query-lang-spec.html (Locations section at the bottom of the page) has a query syntax for spatial queries (i.e. @+40.75-074.00 + 5mi)

            People

            • Assignee:
              Grant Ingersoll
              Reporter:
              Grant Ingersoll
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:

                Development