define_index do
    indexes sex, :sortable => true
    indexes name_as_tenth, :sortable => true
    indexes category, :as => :category, :sortable => true
    indexes disability, :as => :disability, :sortable => true
    indexes certifications(:certificate), :as => :certifications
    indexes skill_records(:skill), :as => :skill

    indexes sslc_record(:year_of_completion), :as => 
:sslc_year_of_completion, :sortable => true
    indexes puc_record(:year_of_completion), :as => 
:puc_year_of_completion, :sortable => true
    indexes user.tests_users(:reg_no), :as =>:reg_no

    has :id, d_o_b
    has user_id, :as=>:profile_user_id
    has sslc_record(:id), :as => :sslc_record_id
    has sslc_record.score, :as => :sslc_score, :type=>:float
    has puc_record(:id), :as => :puc_record_id
    has puc_record.score, :as => :puc_score, :type=>:float

    has diploma_record(:university_id), :as => :diploma_university_id, 
:type=>:integer
    has diploma_record(:specialization_id), :as => 
:diploma_specialization_id, :type=>:integer
    has diploma_record(:score),  :as => :diploma_score, :type=>:float

    has graduation_record(:university_id), :as => 
:graduation_university_id, :type=>:integer
    has graduation_record(:degree_id), :as => :graduation_degree_id, 
:type=>:integer
    has graduation_record(:specialization_id), :as => 
:graduation_specialization_id, :type=>:integer
    has graduation_record(:score),  :as => :graduation_score, :type=>:float
    has "substring(graduation_records.start_date,4,4)", :as => 
:graduation_start_date, :type=>:integer
    has "substring(graduation_records.end_date,4,4)", :as => 
:graduation_end_date, :type=>:integer

    has post_graduation_record(:university_id), 
:as=>:post_graduation_university_id
    has post_graduation_record(:degree_id), :as => 
:post_graduation_degree_id
    has post_graduation_record(:specialization_id), :as => 
:post_graduation_specialization_id
    has post_graduation_record(:score),  :as => :post_graduation_score, 
:type=>:float
    has "substring(post_graduation_records.start_date,4,4)", :as => 
:post_graduation_start_date, :type=>:integer
    has "substring(post_graduation_records.end_date,4,4)", :as => 
:post_graduation_end_date, :type=>:integer


    has user.tests_users.score(:overall_percentile), :as => 
:overall_percentile

    has user.tests_users.score(:subsection1_percentile), :as => 
:subsection1_percentile
    has user.tests_users.score(:subsection2_percentile), :as => 
:subsection2_percentile
    has user.tests_users.score(:subsection3_percentile), :as => 
:subsection3_percentile

    has user.tests_users.score(:test_id), :as => :test_ids
end

search query can be like

Profile.search_for_ids 
:with=>{:overall_percentile=>(94..100),:subsection1_percentile=>(99..100),:subsection2_percentile=>(90..99)}

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/thinking-sphinx/-/Qa_j2LlhR0UJ.
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.

Reply via email to