Commits

coady committed 2d0e33a

Deprecated spatial contrib module.

  • Participants
  • Parent commits b16ceb5

Comments (0)

Files changed (3)

File docs/engine.rst

 
 TokenFilter
 ^^^^^^^^^^^^^
-.. autoclass:: TokenFilter
+.. autoclass:: lupyne.engine.TokenFilter
   :show-inheritance:
   :members:
 
 Analyzer
 ^^^^^^^^^^^^^
-.. autoclass:: Analyzer
+.. autoclass:: lupyne.engine.Analyzer
   :members:
 
 IndexReader
 
 IndexSearcher
 ^^^^^^^^^^^^^
-.. autoclass:: IndexSearcher
+.. autoclass:: lupyne.engine.IndexSearcher
   :show-inheritance:
   :members:
 
 
 MultiSearcher
 ^^^^^^^^^^^^^
-.. autoclass:: MultiSearcher
+.. autoclass:: lupyne.engine.MultiSearcher
   :show-inheritance:
 
 IndexWriter
 ^^^^^^^^^^^^^
-.. autoclass:: IndexWriter
+.. autoclass:: lupyne.engine.IndexWriter
   :show-inheritance:
   :members:
 
 
 Indexer
 ^^^^^^^^^^^^^
-.. autoclass:: Indexer
+.. autoclass:: lupyne.engine.Indexer
   :show-inheritance:
   :members:
 
 
 Document
 ^^^^^^^^^^^^^
-.. autoclass:: Document
+.. autoclass:: lupyne.engine.Document
   :show-inheritance:
   :members:
 
 
 Field
 ^^^^^^^^^^^^^
-.. autoclass:: Field
+.. autoclass:: lupyne.engine.Field
   :members:
 
 FormatField
 ^^^^^^^^^^^^^
-.. autoclass:: FormatField
+.. autoclass:: lupyne.engine.FormatField
   :show-inheritance:
   :members:
 
 
 NestedField
 ^^^^^^^^^^^^^
-.. autoclass:: NestedField
+.. autoclass:: lupyne.engine.NestedField
   :show-inheritance:
   :members:
 
 NumericField
 ^^^^^^^^^^^^^
-.. autoclass:: NumericField
+.. autoclass:: lupyne.engine.NumericField
   :show-inheritance:
   :members:
 
 DateTimeField
 ^^^^^^^^^^^^^
-.. autoclass:: DateTimeField
+.. autoclass:: lupyne.engine.DateTimeField
   :show-inheritance:
   :members:
 
 
 Query
 ^^^^^^^^^^^^^
-.. autoclass:: Query
+.. autoclass:: lupyne.engine.Query
   :members:
 
   .. automethod:: __and__
 
 SortField
 ^^^^^^^^^^^^^
-.. autoclass:: SortField
+.. autoclass:: lupyne.engine.SortField
   :show-inheritance:
   :members:
 
 
 PointField
 ^^^^^^^^^^^^^
-.. autoclass:: PointField
+.. autoclass:: lupyne.engine.PointField
   :show-inheritance:
   :members:
 
 PolygonField
 ^^^^^^^^^^^^^
-.. autoclass:: PolygonField
+.. autoclass:: lupyne.engine.PolygonField
   :show-inheritance:
   :members:
 
   :members:
 
   .. automethod:: __getitem__
-
-DistanceFilter
-^^^^^^^^^^^^^^^^^^
-.. autoclass:: DistanceFilter
-  :members:
-
-  .. automethod:: __getitem__

File lupyne/engine/spatial/__init__.py

 """
 
 import itertools
+import warnings
 import lucene
 from .globalmaptiles import GlobalMercator
 from ..queries import Query
         return Query.any(*itertools.starmap(self.range, slices))
     def filter(self, lng, lat, distance, lngfield, latfield, limit=Tiler.base):
         """Return lucene LatLongDistanceFilter based on :meth:`within` query.
-        Alternative distance comparator which requires the spatial contrib module.
-        Distances estimates may be more accurate, and performance may vary.
+        
+        .. deprecated:: 1.1+ spatial contrib module deprecated as of lucene 3.6
         """
         filter = self.within(lng, lat, distance, limit).filter()
         return DistanceFilter(filter, lng, lat, distance, lngfield, latfield)
     "Inherited lucene LatLongDistanceFilter which supports the comparator interface."
     meters = 1609.344
     def __init__(self, filter, lng, lat, distance, lngfield, latfield):
+        warnings.warn('Spatial contrib module deprecated as of lucene 3.6.', DeprecationWarning)
         lucene.LatLongDistanceFilter.__init__(self, filter, lat, lng, distance / self.meters, latfield, lngfield)
     def __getitem__(self, id):
         distance = self.getDistance(id)

File test/local.py

         assert len(field.within(x, y, 10**8)) == 1
         self.assertRaises(NameError, list, field.radiate(y, x, 1, 0))
         if hasattr(lucene, 'LatLongDistanceFilter'):
-            f = field.filter(x, y, 10**4, 'longitude', 'latitude')
+            with assertWarns(DeprecationWarning):
+                f = field.filter(x, y, 10**4, 'longitude', 'latitude')
             ids = indexer.search(query, sort=distances.__getitem__).ids
             hits = indexer.search(count=10, filter=f, sort=f.sorter())
             assert len(hits) < len(ids) and hits.ids == ids[:len(hits)]