Jump to content
Дизайн и модификация Invision Power Board IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Mac

Sphinx находит не все посты и записи блогов (3.4.6)

Recommended Posts

Для начала выяснить если блоги вообще поддерживают поиск по сфинксу.

Share this post


Link to post
Share on other sites

Да вроде поддерживают:

################################# --- BLOG --- ##############################

source ipb_blog_search_main : ipb_ipb_source_config
{
   # Set our forum PID counter
   sql_query_pre   = REPLACE INTO ipb_cache_store VALUES( 'sphinx_blog_counter', (SELECT max(entry_id) FROM ipb_blog_entries), 0, UNIX_TIMESTAMP(), 0 )

   # Query posts for the main source
   sql_query       = SELECT e.entry_id, e.entry_id as search_id, e.entry_name, e.entry_name as tordinal, e.entry, e.entry_date, e.entry_author_id, e.entry_num_comments, e.blog_id, \
                            b.blog_owner_only, b.blog_private, b.blog_disabled, \
                           CASE WHEN e.entry_status='published' THEN 0 ELSE e.entry_author_id END AS entry_not_published, \
                           CASE WHEN b.blog_owner_only=0 THEN 0 ELSE b.member_id END AS blog_owner_id, \
                           CASE WHEN b.blog_authorized_users IS NULL THEN 0 ELSE 1 END AS authorized_users \
                       FROM ipb_blog_entries e \
                     LEFT JOIN ipb_blog_blogs b ON ( b.blog_id=e.blog_id )

   # Fields    
   sql_attr_uint           = search_id
   sql_attr_uint           = blog_owner_only
   sql_attr_timestamp      = entry_date
   sql_attr_string         = tordinal
   sql_attr_uint           = entry_author_id
   sql_attr_uint           = entry_num_comments
   sql_attr_uint           = blog_id
   sql_attr_uint           = blog_private
   sql_attr_uint           = blog_disabled
   sql_attr_uint           = entry_not_published
   sql_attr_uint           = blog_owner_id
   sql_attr_uint           = authorized_users
   sql_attr_multi          = uint tag_id from query; SELECT tag_meta_id, tag_id FROM ipb_core_tags WHERE tag_meta_app='blog' AND tag_meta_area='entries'
   sql_ranged_throttle = 0
}

source ipb_blog_search_delta : ipb_blog_search_main
{
   # Override the base sql_query_pre
   sql_query_pre = 

   # Query posts for the delta source
   sql_query       = SELECT e.entry_id, e.entry_id as search_id, e.entry_name, e.entry_name as tordinal, e.entry, e.entry_date, e.entry_author_id, e.entry_num_comments, e.blog_id, b.blog_owner_only, b.blog_private, b.blog_disabled, \
                           CASE WHEN e.entry_status='published' THEN 0 ELSE e.entry_author_id END AS entry_not_published, \
                           CASE WHEN b.blog_owner_only=0 THEN 0 ELSE b.member_id END as blog_owner_id, \
                           CASE WHEN b.blog_authorized_users IS NULL THEN 0 ELSE 1 END AS authorized_users \
                       FROM ipb_blog_entries e \
                     LEFT JOIN ipb_blog_blogs b ON ( b.blog_id=e.blog_id ) \
                     WHERE e.entry_id > ( SELECT cs_value FROM ipb_cache_store WHERE cs_key='sphinx_blog_counter' )    
}

index ipb_blog_search_main
{
   source          = ipb_blog_search_main
   path            = /var/lib/sphinx/mysite_ipb/ipb_blog_search_main

   docinfo         = extern
   mlock           = 0
   morphology      = none
   min_word_len    = 2
   charset_type    = utf-8
   html_strip      = 0
   #infix_fields    = entry_name, entry
   #min_infix_len   = 3
   #enable_star     = 1
}

index ipb_blog_search_delta : ipb_blog_search_main
{
  source           = ipb_blog_search_delta
  path             = /var/lib/sphinx/mysite_ipb/ipb_blog_search_delta
}

source ipb_blog_comments_main : ipb_ipb_source_config
{
   # Set our forum PID counter
   sql_query_pre   = REPLACE INTO ipb_cache_store VALUES( 'sphinx_blog_comments_counter', (SELECT max(comment_id) FROM ipb_blog_comments), 0, UNIX_TIMESTAMP(), 0 )

   # Query posts for the main source
   sql_query       = SELECT c.comment_id, c.comment_id as search_id, c.member_id as comment_member_id, c.comment_date, c.comment_approved, c.comment_text, \
                            e.entry_id, e.entry_name as tordinal, e.entry_date, e.entry_author_id, e.entry_num_comments, e.blog_id, \
                            b.blog_owner_only, b.blog_private, b.blog_disabled, \
                           CASE WHEN e.entry_status='published' THEN 0 ELSE e.entry_author_id END AS entry_not_published, \
                           CASE WHEN b.blog_owner_only=0 THEN 0 ELSE b.member_id END AS blog_owner_id, \
                           CASE WHEN b.blog_authorized_users IS NULL THEN 0 ELSE 1 END AS authorized_users, \
                           CONCAT(e.entry_last_comment_date, '.', e.entry_id ) as last_post_group \
                       FROM ipb_blog_comments c \
                     LEFT JOIN ipb_blog_entries e ON ( c.entry_id=e.entry_id ) \
                     LEFT JOIN ipb_blog_blogs b ON ( b.blog_id=e.blog_id )

   # Fields    
   sql_attr_uint           = search_id
   sql_attr_uint           = entry_id
   sql_attr_uint           = blog_owner_only
   sql_attr_timestamp      = entry_date
   sql_attr_string         = tordinal
   sql_attr_uint           = entry_author_id
   sql_attr_uint           = entry_num_comments
   sql_attr_uint           = blog_id
   sql_attr_uint           = blog_private
   sql_attr_uint           = blog_disabled
   sql_attr_uint           = entry_not_published
   sql_attr_uint           = blog_owner_id
   sql_attr_uint           = authorized_users
   sql_attr_uint           = last_post_group
   sql_attr_timestamp      = comment_date
   sql_attr_uint           = comment_member_id
   sql_attr_uint           = comment_approved
   sql_ranged_throttle = 0
}

source ipb_blog_comments_delta : ipb_blog_comments_main
{
   # Override the base sql_query_pre
   sql_query_pre = 

   # Query posts for the delta source
   sql_query       = SELECT c.comment_id, c.comment_id as search_id, c.member_id as comment_member_id, c.comment_date, c.comment_approved, c.comment_text, \
                            e.entry_id, e.entry_name as tordinal, e.entry_date, e.entry_author_id, e.entry_num_comments, e.blog_id, \
                            b.blog_owner_only, b.blog_private, b.blog_disabled, \
                           CASE WHEN e.entry_status='published' THEN 0 ELSE e.entry_author_id END AS entry_not_published, \
                           CASE WHEN b.blog_owner_only=0 THEN 0 ELSE b.member_id END AS blog_owner_id, \
                           CASE WHEN b.blog_authorized_users IS NULL THEN 0 ELSE 1 END AS authorized_users, \
                           CONCAT(e.entry_last_comment_date, '.', e.entry_id ) as last_post_group \
                       FROM ipb_blog_comments c \
                     LEFT JOIN ipb_blog_entries e ON ( c.entry_id=e.entry_id ) \
                     LEFT JOIN ipb_blog_blogs b ON ( b.blog_id=e.blog_id ) \
                     WHERE c.comment_id <= ( SELECT cs_value FROM ipb_cache_store WHERE cs_key='sphinx_blog_comments_counter' )    
}

index ipb_blog_comments_main
{
   source          = ipb_blog_comments_main
   path            = /var/lib/sphinx/mysite_ipb/ipb_blog_comments_main

   docinfo         = extern
   mlock           = 0
   morphology      = none
   min_word_len    = 2
   charset_type    = utf-8
   html_strip      = 0
   #infix_fields    = comment_text
   #min_infix_len   = 3
   #enable_star     = 1
}

index ipb_blog_comments_delta : ipb_blog_comments_main
{
  source           = ipb_blog_comments_delta
  path             = /var/lib/sphinx/mysite_ipb/ipb_blog_comments_delta
}

Share this post


Link to post
Share on other sites

Как я и подозревал, это был баг. Добил ТП, исправили. Всем, у кого стоит сфинкс, советую внести этот багфикс.

 

А вам, siv1987, большое человеческое спасибо за участие! А то в других сообществах IPB просто глухая стена.

Edited by Mac

Share this post


Link to post
Share on other sites

Поиск Сфинкс конечно отличный - ищет мгновенно.

 

Однако не решил проблему как у автора топика - максимальное кол-во страниц 40, как не меняй разные параметры в файлах :(

 

И ещё. Индексация всего контента раз в сутки (не нового, новый контент индексируеться каждые десять минут за микросекунды) занимает почти две минуты, и всё время это форум простаивает. Можно ли как то оптимизировать индексацию?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...