Closed (fixed)
Project:
Search API Location
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2012 at 09:14 UTC
Updated:
13 May 2017 at 08:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
grasmash commentedAre you using geofield?
Comment #2
jschoder commentedNo. I am using Location. But as the description is saying it should work with Location as well.
After applying all the mentioned patches I still have one issue: The "LatLong Pair" doesn't turn up since Location currently doesn't offer a LatLong-Pair. The not yet applied new patch for Location that offers Entity integration has to be expanded by adding a LatLong-Pair. I will try to add the change locally and add the patch to Location as soon as everything seems to work out.
Comment #3
fragtom commentedI've tested to make an "computed field" with location-data, but the cf-field did not appear, too.. In a other project, I used geofield for holding geo-data.. That's really comfortable, but in the moment I'm not sure to migrate location-data to geofield, because I have not enough tested with location-pattern and other stuff with the geofield..
Comment #4
grasmash commentedYeah, I'm not sure that this module actually does work with location. I haven't seen anything in the code to suggest that it does.
Comment #5
drunken monkeyThe module, or rather the "Latitude/longitude" data type, require a comma-separated latitude and longitude as their base data. This is currently provided by the "LatLon Pair" property of Geofields.
If Location can also produce this format, it will work, otherwise it won't.
We could think about adding a processor to convert common other formats to ours, though, to resolve this issue.
Comment #6
drunken monkeyComment #7
Media Crumb commentedYou know where I stand on this one DK!
Love to see that supported.
:)
Comment #8
gambryNot sure if work made any progress, but as issue is still active I think is still on going.
Notable quick-and-dirty solution can be found here, using as
hook_search_api_solr_documents_alter():HOWEVER this solution won't work for multi-values location fields and additionally it's impossible to include in any module due the UI admin action of creating an aggregate field.
Another solution could be to extend the location subfields including a LatLong pair item.
Below an example targetting a 'field_location' on node type 'event':
This could be easily extendible looping and updating all instances of location types (using
field_read_fields(array('type' => 'location'))and thenfield_read_instances()) so I'm more than happy to provide a patch.Of course it would be much simpler and better if done directly on location module. :(
Comment #9
drunken monkeyAs said:
I think this should be simple enough to implement, so if you want to give that a try, go ahead!
Comment #10
gambryI left a comment on this issue as I think the Location module should be the house for this change.
If nobody replies in few weeks I'll suggest a patch in here.
Is that ok?
Comment #11
drunken monkeyYes, sounds good. Thanks!
Comment #12
mausolos commentedI cannot get this to work, with or without the patch. No matter what I do, the lat/lng field does not come up, either in the field list or the add field drop-down. I do get the Address field, but since my goal is to search via view that has/returns province, state, country and title (with each of these as an independent output field), Address is almost useless.
Location Entity was enabled from the get-go. Not sure what to do next. Any ideas? Did I miss something?
Thanks!
Charles
Comment #13
drunken monkeyThis should add support for Location fields.
Modules: Location, Location CCK, Location Entity.
On the index's "Fields" page, add the location field under "Add related fields". With this patch (and possibly after clearing cache, if you just applied it) one of the sub-fields will be "Latitude/longitude pair", machine name "latlon". Use that with the "Latitude/longitude pair" Search API field type and then proceed as normal.
Please review, and I can commit!
Comment #14
jandewit6 commentedWorks as a charm!
Thanks very much.
Comment #16
drunken monkeyGood to hear, thanks for testing!
Committed.