News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Install Sphinx Search?

Started by keptang, November 01, 2007, 03:27:23 PM

Previous topic - Next topic

H

Welcome to SMF
Are you actually experiencing any problems with the current mod? Most likely nobody has updated it, unless there have been changes to Sphinx which actually prevent it from working
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

H

I'll double check, but I believe the one I posted above may still be the latest :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

moder

Quote from: H on June 04, 2009, 11:54:38 AM
Welcome to SMF
Are you actually experiencing any problems with the current mod? Most likely nobody has updated it, unless there have been changes to Sphinx which actually prevent it from working
Thanks.
If the morphology is included (morphology = stem_ru) - in results there are no quote with allotted search result by means of morphology.
Who can correct it?

moder

I am sorry for my English.
As an example, stem_en should truncate ' walking ' to ' walk '.
It so, turns out for ' walking ' we see in results of search the allocated words "' walking '", and by a word "' walk" is not present, only links to topic and author (topic and last post).
And so Mod works well, only sphinx.conf it is necessary to correct a little under new syntax Sphinx.
It is possible to receive a word on which searched Sphinx (for example "walk" by search "walking")?

raklet

I have Sphinx 0.9.9-rc2 running on SMF 1.1.9.  Things went well enough.  Now that I am using Sphinx instead of fulltext, can I remove the fulltext index from the messages table and convert the table to InnoDB so that I can do incremental backups of the database?

FaBMak

In default installation of SMF, the seach results is ordered by relevance. With Sphinx this isn't occurring, as you can see the example in the attachment.

How do i fix this ?

FaBMak

Quote from: Arantor on August 23, 2009, 07:05:22 PM
Can I see your configuration file? The one here is calculated from a custom formula; there is nothing in Sphinx by default to generate a 'relevance' like that.

I think the problem is how the search result is sorted, the relevance is calculate right. This happen with you ?

#
# Sphinx configuration file (sphinx.conf), configured for SMF 1.1
#
# By default the location of this file would probably be:
# /usr/local/etc/sphinx.conf

source smf_source
{
type = mysql
strip_html = 1
sql_host = localhost
sql_user = *******
sql_pass = *******
sql_db = db
sql_port = 3306
sql_query_pre = \
REPLACE INTO `db`.smf_settings (variable, value) \
SELECT 'sphinx_indexed_msg_until', MAX(ID_MSG) \
FROM `db`.smf_messages
sql_query_range = \
SELECT 1, value \
FROM `db`.smf_settings \
WHERE variable = 'sphinx_indexed_msg_until'
sql_range_step = 1000
sql_query = \
SELECT \
m.ID_MSG, m.ID_TOPIC, m.ID_BOARD, IF(m.ID_MEMBER = 0, 4294967295, m.ID_MEMBER) AS ID_MEMBER, m.posterTime, m.body, m.subject, \
t.numReplies + 1 AS numReplies, CEILING(1000000 * ( \
IF(m.ID_MSG < 0.7 * s.value, 0, (m.ID_MSG - 0.7 * s.value) / (0.3 * s.value)) * 25 + \
IF(t.numReplies < 200, t.numReplies / 200, 1) * 20 + \
IF(m.ID_MSG = t.ID_FIRST_MSG, 1, 0) * 10 + \
IF(t.isSticky = 0, 0, 1) * 0 \
) / 55) AS relevance \
FROM `db`.smf_messages AS m, `db`.smf_topics AS t, `db`.smf_settings AS s \
WHERE t.ID_TOPIC = m.ID_TOPIC \
AND s.variable = 'maxMsgID' \
AND m.ID_MSG BETWEEN $start AND $end
sql_group_column = ID_TOPIC
sql_group_column = ID_BOARD
sql_group_column = ID_MEMBER
sql_date_column = posterTime
sql_date_column = relevance
sql_date_column = numReplies
sql_query_info = \
SELECT * \
FROM `db`.smf_messages \
WHERE ID_MSG = $id
}

source smf_delta_source : smf_source
{
sql_query_pre =
sql_query_range = \
SELECT s1.value, s2.value \
FROM `db`.smf_settings AS s1, `db`.smf_settings AS s2 \
WHERE s1.variable = 'sphinx_indexed_msg_until' \
AND s2.variable = 'maxMsgID'
}

index smf_base_index
{
source = smf_source
path = /var/sphinx/data/smf_sphinx_base.index
min_word_len = 2
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, _, a..z
}

index smf_delta_index : smf_base_index
{
source = smf_delta_source
path = /var/sphinx/data/smf_sphinx_delta.index
}

index smf_index
{
type = distributed
local = smf_base_index
local = smf_delta_index
}

indexer
{
mem_limit = 32M
}

searchd
{
port = 3312
log = /var/sphinx/log/searchd.log
query_log = /var/sphinx/log/query.log
read_timeout = 5
max_children = 30
pid_file = /var/sphinx/data/searchd.pid
max_matches = 1000
}

FaBMak

There is no API in this thread. Only the Sphinx configurator and MOD. I'm using the Sphinx 0.9.9-RC2 and i copy the api/sphinxapi.php from sources files to SMF Sources directory.

FaBMak

I'm using the MOD from this thread. Yes, there is some errors when i start the Sphinx, but the is no fatal errors.

FaBMak

I found it!

Change Sources/Search.php
From:
$mySphinx->SetGroupBy('ID_TOPIC', SPH_GROUPBY_ATTR);
To:
$mySphinx->SetGroupBy('ID_TOPIC', SPH_GROUPBY_ATTR, 'relevance DESC' );

steve51184

any chance of an update to this mod with the latest version of Sphinx for smf 1.1.10

steve51184

ok but that is 2 years old.. can't someone do a quick edit for us who have smf 1.1.10 and Sphinx 0.9.9-rc2? PLEASE?

steve51184

so how hard is it and how long would it take?

steve51184

Quote from: Arantor on September 08, 2009, 10:47:00 AM
Out of interest, how big is your forum?

365k Posts in 93k Topics by 78k Members

steve51184

Quote from: Arantor on September 08, 2009, 11:04:36 AM
Ah, so you're in the category of user that would begin to benefit from it, and you're probably on a VPS where you can compile your own software.

Are you using a Large Custom index in the interim?

i have my own full root server and no i use no index atm (i know, i know.. lol)

steve51184

well i've tried Fulltext index but it's not any faster then No index in fact it might be a little slower :\

steve51184

so what's the point in a full text index if it's slower?

Ensiferous

Arantor, let me know if you need a hand with the sphinx integration. Forum search is actually the slowest part of my site right now, and since my site search uses sphinx already I figured that'd be the natural progressing, so I'm damn glad you're already working on this.
My Latest Blog Post: Debugging Nginx Errors

Ensiferous

Jesus christ, just had a look at the search function and it's 1500 bloody lines... It's times like this I really wish SMF had nicer code. =/
My Latest Blog Post: Debugging Nginx Errors

Something like that

Quote from: Ensiferous on September 12, 2009, 09:23:27 PM
Jesus christ, just had a look at the search function and it's 1500 bloody lines... It's times like this I really wish SMF had nicer code. =/

The code is actually pretty nice. it's the number of features that are responsible for the code size.

Advertisement: