All,
I am pretty new to ThinkingSphnix, and I love it as how fast the searches
are. But, I am having hard time trying to figure out how "geo" search
works. I'm struggling to find the solutions since more than a week and end
up (headbang) every time. Hope, I get some help on this:
Indexing:
################# Indexing ################################
define_index do
indexes :professional_nickname, :as => :name, :sortable => true
indexes :zip_code
indexes :address
indexes :city
indexes :country
indexes services(:name), :as => :service,:type => :string, :facet =>
true
has tattoo_styles(:id), :as => :tattoo_styles, :facet => :true
has categories(:id), :as => :categories, :facet => :true
indexes languages(:name), :as => :languages, :facet => true
indexes specialities(:name), :as => :speciality, :type => :string,
:facet => true
has created_at
has 'RADIANS(artists.lat)', :as => :latitude, :type => :float
has 'RADIANS(artists.lon)', :as => :longitude, :type => :float
where "artists.admin_approved = '1'"
set_property :charset_table => "0..9, A..Z->a..z, _,
a..z,U+410..U+42F->U+430..U+44F, U+430..U+44F"
set_property :group_concat_max_len => 8192
set_property :delta => true
set_property :field_weights => {
"name" => 100,
"zip_code" => 70,
"artist_services" => 60
}
end
Search:
Artist.facets(92107,{:geo=>[0.5714378699136865, -2.046398109885709],
:latitude_attr=>"latitude", :longitude_attr=>"longitude",
:with=>{"@geodist"=>0.0..10000000000.0}, :sort=>"created_at",
:sort_mode=>"desc"}) #returns only 1 artist that is from 92107 zipcode. I
have others artist from 92110 and 92154.
Also, I need to give @geodist value very high inorder to retrieve the first
result. If I do, "@geodist" => 0.00..10000.0, it doesn't even give me the
matching result.
Thinking Sphnix version: 2.0.7
Any help will be appreciated. Thanks in-advance.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/groups/opt_out.