Answer the question
In order to leave comments, you need to log in
How to get attributes in search results when searching multiple indexes in SphinxSearch version 2.1?
There is a code:
$sphinx->query('зеленые человечки', 'idx_posts_user_1,idx_posts_user_2');
[attrs] => Array
(
[user_id] => 1
)
[matches] => Array
(
[13] => Array
(
[weight] => 1
[attrs] => Array
(
[user_id] => 2
)
)
[fields] => Array
(
[0] => post_text
)
[attrs] => Array
(
)
[matches] => Array
(
[11] => Array
(
[weight] => 1
[attrs] => Array
(
)
)
source posts_user_1 : base
{
sql_query = SELECT id, user_id, post_text FROM posts WHERE user_id = 1
sql_attr_uint = user_id
}
index idx_posts_user_1
{
source = posts_user_1
path = ./data/posts_user_1
docinfo = extern
morphology = stem_en
charset_type = utf-8
}
source posts_user_2 : base
{
sql_query = SELECT id, user_id, post_text FROM posts WHERE user_id = 2
sql_attr_uint = user_id
}
index idx_posts_user_2
{
source = posts_user_2
path = ./data/posts_user_2
docinfo = extern
morphology = stem_en
charset_type = utf-8
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question