# Problem, specify fields with :includes in indexing & search

**URL:** <https://www.ruby-forum.com/t/problem-specify-fields-with-includes-in-indexing-search/127125>\
**Category:** Rails\
**Created:** [January 25, 2008, 5:42am UTC](https://www.ruby-forum.com/t/problem-specify-fields-with-includes-in-indexing-search/127125 "2008-01-25T05:42:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ed8c4c/32.png) [@nad](https://www.ruby-forum.com/u/nad)\
**Post date:** [January 25, 2008, 5:42am UTC](https://www.ruby-forum.com/t/problem-specify-fields-with-includes-in-indexing-search/127125/1 "2008-01-25T05:42:39Z")

</div>

hi all

i have 2 models as bellow. what i want to do is when the data is save  
to the following table it has to index with data in all the files in  
the both models.

so when i search search through the acts\_as\_solr it should search that  
key word is in the both models and should be able to get the  
Jobseeker.id from it.

i tried to implement the link between two model with the :include  
function in acts\_as\_sorl

bt when i searched it does not works properly as it allow only to  
search data in only one model at a time. (i tried to put the :include  
function in various ways tooo.)

can some body pls help me to add this links and allow to do the  
indexing and searching pro ply.

is can pls tell me how to put the codes…

class Jobseeker \< ActiveRecord::Base  
# Declaring the relationship with other tables  
has\_one :jobseeker\_professional\_detail  
has\_many :applied\_job  
has\_one :confidentiality\_reason  
has\_many :viewed\_resume  
has\_many :interview

end

class JobseekerProfessionalDetail \< ActiveRecord::Base  
belongs\_to :jobseeker  
end

Thanks  
Nadeesha
