help me please to solve it:
i have the following configuration of UltraSphinx:
------------------------------------------------------------------------------
config/ultrasphinx/development.conf:
------------------------------------------------------------------------------
...
sql_query = \
SELECT user.id as user_id, \
user.created_at as created_at, \
profile.first_name as first_name, \
profile.last_name as last_name, \
profile.city_name as city_name, \
profile.interests as interests, \
country.id as country_id, \
space.name as space_name, \
profile_language.language_id as language_id \
FROM users as user INNER JOIN my_prof as profile on
profile.user_id=user.id \
LEFT OUTER JOIN my_country as country on
profile.country_id=country.id \
LEFT OUTER JOIN my_space as space on space.owner_id=user.id \
LEFT OUTER JOIN my_languages as profile_language on
profile_language.profile_id=profile.id \
WHERE user.id >= $start AND user.id <= $end
...
------------------------------------------------------------------------------
i want implement a full text search only for the next columns:
first_name, last_name, e_mail.
But in result, for example, "Ultrasphinx::Search.new(:query =>
''kjhui'').run" get a hash of the following keys(columns
name) with
value(result query):
for example:
:user_id => 1, :created_at => ''12.05.08'', :first_name
=> ''kjhui'',
:last_name => ''test'', :city_name =>
''Chech'', :interests => ''football'',
:country_id => 12, :space_name => ''street'', :language_id
=> 45
How can i do it?
Help me please.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Your UltraSphinx setup and the returned columns
of a query have nothing to do with each other.
The US setup only defines how US should query
the database to git it''s index values
is_indexed :fields => [first_name, last_name, e_mail],
:delta => {:field => "updated_at"}
would be all you need in your User model
@search = Ultrasphinx::Search.new(:query => ''kjhui'')
@users = @search.run
should return the full set of columns in the users table
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Thorsten Mueller wrote:> Your UltraSphinx setup and the returned columns > of a query have nothing to do with each other. > > The US setup only defines how US should query > the database to git it''s index values > > is_indexed :fields => [first_name, last_name, e_mail], > :delta => {:field => "updated_at"} > > would be all you need in your User model > > @search = Ultrasphinx::Search.new(:query => ''kjhui'') > @users = @search.run > > should return the full set of columns in the users tablethanks for answer, 1) but how can i get data from other tables(my_prof, my_country, my_space, my_languages)?(I want to get data near as SQL query(that i write in config/ultrasphinx/development.conf) is returned) 2) Can US also returned data from users, my_prof, my_country, my_space, my_languages also? How can i implement this? Help me please to solve it problem. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > thanks for answer, > 1) but how can i get data from other tables(my_prof, my_country, > my_space, my_languages)?(I want to get data near as SQL query(that i > write in config/ultrasphinx/development.conf) is returned) > 2) Can US also returned data from users, my_prof, my_country, my_space, > my_languages also? > > How can i implement this? > > Help me please to solve it problem.I''m also wondering about this. Is there a way to return which field(s) the search word is found in for each User? I''ve been looking, but have not found a way to do this. -- Posted via http://www.ruby-forum.com/.