Exemplo n.º 1
0
 def __call__(self, doc):
     # we want to return a sortable string which represents
     # the distance from Washington, DC to the middle of this
     # state.
     coords = map(float, doc.get_value(4).split(","))
     washington = (38.012, -77.037)
     return xapian.sortable_serialise(support.distance_between_coords(coords, washington))
Exemplo n.º 2
0
 def __call__(self, doc):
     # we want to return a sortable string which represents
     # the distance from Washington, DC to the middle of this
     # state.
     coords = map(float, doc.get_value(4).split(','))
     washington = (38.012, -77.037)
     return xapian.sortable_serialise(
         support.distance_between_coords(coords, washington))
Exemplo n.º 3
0
 def __call__(self, doc):
     # we want to return a sortable string which represents
     # the distance from Washington, DC to the middle of this
     # state.
     value = doc.get_value(4).decode('utf8')
     x, y = map(float, value.split(','))
     washington = (38.012, -77.037)
     return xapian.sortable_serialise(
         support.distance_between_coords((x, y), washington)
         )