Ok, so this patch checks local_options as well as options for lat/lon
attrs.
--
Matthew Beale :: 607 227 0871
Resume & Portfolio @ http://madhatted.com
On Mon, 2009-06-15 at 16:01 -0400, Matthew Beale wrote:
> Hey all,
>
> I'm staring at anchor_conditions in lib/thinking_sphinx/search.rb and
> set_single_property in lib/thinking_sphinx/index/builder.rb.
>
> I have a 'set_property :latitude_attr => "radian_latitude"' in my index.
> set_single_property is putting that in local_options instead of options.
> anchor_conditions is only checking options for lat/log attr, not
> local_options.
>
> I'm not sure what to fix- should anchor_conditions ignore local_options?
> My set_property is bumped to local_options b/c a property of that name
> already exists, is that intended?
>
> Very confused. This was working until I just pulled fresh code down.
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---
diff --git a/lib/thinking-sphinx/lib/thinking_sphinx/search.rb b/lib/thinking-sphinx/lib/thinking_sphinx/search.rb
index 22f8d83..ffbc352 100644
--- a/lib/thinking-sphinx/lib/thinking_sphinx/search.rb
+++ b/lib/thinking-sphinx/lib/thinking_sphinx/search.rb
@@ -642,11 +642,11 @@ module ThinkingSphinx
}.flatten : []
lat_attr = klass ? klass.sphinx_indexes.collect { |index|
- index.options[:latitude_attr]
+ index.local_options[:latitude_attr] || index.options[:latitude_attr]
}.compact.first : nil
lon_attr = klass ? klass.sphinx_indexes.collect { |index|
- index.options[:longitude_attr]
+ index.local_options[:longitude_attr] || index.options[:longitude_attr]
}.compact.first : nil
lat_attr = options[:latitude_attr] if options[:latitude_attr]