Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

I need to search on three columns of different table with a single query request in sphinx

So Basically i have two tables 1) questions 2) question_images. questions table has the
fields (question_id, question_title, question_description) while the question_images has
the fields (question_image_id,question_id AS Foreign key, question_image_text). Now I
need to search from the fields questions_title, question_description and
question_image_text. My source and index is defined as follow:

source expert_question_description
{
type = mysql

            sql_host = localhost
            sql_user = **
            sql_pass = **
            sql_db = **
            sql_port = 3306

            sql_query = \
                            SELECT a.question_id, a.question_title,
                            a.question_description,coalesce(b.question_image_text,'') \
                            FROM si_questions a LEFT JOIN si_question_images b ON a.question_id = b.question_id

}

index expert_question_description
{
source = expert_question_description
path = /var/lib/sphinx/expert_question_description
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, _, a..z, \
U+410..U+42F->U+430..U+44F, U+430..U+44F, U+401->U+451, U+0021..U+002F, U+003A..U+003F,
U+005B..U+005F, U+007B..U+007E
}

index expert_question_description_rtindex
{
type = rt
rt_mem_limit = 256M

            path = /var/lib/sphinx/expert_question_description_rtindex

            rt_field = question_title
            rt_field = question_description
            rt_attr_uint = question_id

}

indexer
{
mem_limit = 128M
}

searchd
{
listen = 9312
listen = 9306:mysql41
log = /var/log/sphinx/searchd.log
query_log = /var/log/sphinx/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinx/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
binlog_path = /var/lib/sphinx/
}

Now i am not getting the results from qestion_image_text. I also confused how sphinx
searches in the datasource(Mean which column). Thanks in advance!

Tagged:
Sign In or Register to comment.