0
votes

I have simple table

id: primary
name: varchar fulltext index

here is my Sphinx config https://justpaste.it/1okop

Indexer warns about docinfo

Sphinx 2.2.11-id64-release (95ae9a6) Copyright (c) 2001-2016, Andrew Aksyonoff Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'... indexing index 'words'... WARNING: Attribute count is 0: switching to none docinfo collected 10000 docs, 0.1 MB sorted 0.0 Mhits, 100.0% done total 10000 docs, 79566 bytes total 0.065 sec, 1210829 bytes/sec, 152179.20 docs/sec total 3 reads, 0.000 sec, 94.6 kb/call avg, 0.0 msec/call avg total 9 writes, 0.000 sec, 47.5 kb/call avg, 0.0 msec/call avg

But it's said here Sphinx: WARNING: Attribute count is 0: switching to none docinfo that it's nothing seriouse.

OK, starting service and search for part of the word:

SELECT *
FROM test_words
where match (name) AGAINST ('lema')
No rows.

Tha same as
SELECT *
FROM test_words
where match (name) AGAINST ('*lema*')

No rows.

And in the same time there are results for query

SELECT *
FROM `test_words`
where position('lema' in name)>0

so as far as I can see - Sphinx is not searching by part of a word. Why and how to fix it?

And - if I uncomment

min_infix_len = 3 
infix_fields = name

I get

WARNING: index 'words': prefix_fields and infix_fields has no effect with dict=keywords, ignoring

And one more - show engines; show no Sphinx engine, is it normal now? mysql service was restarted.

All sql queries were run through Adminer logged in localhost:3312

1

1 Answers

0
votes

There's no functions like position() or syntax like 'match(name) against' in Sphinx. According to your config your index is 'words' while your requests are against 'test_words' which is the source table you build your index from. So it seems to me you're connecting not to Sphinx, but to mysql. If you're looking for closer integration between MySQL and Sphinx try SphinxSE (http://sphinxsearch.com/docs/devel.html#sphinxse), it will then show up in "SHOW ENGINES" or if you don't want to deal with compiling MySQL with SphinxSE enable you might want to try Manticore Search (a fork of Sphinx) since it has integration with FEDERATED engine (https://docs.manticoresearch.com/2.6.4/html/federated_storage_engine.html) which is by default compiled in mysql, you just need to start it properly to enable it.

If you want to use Sphinx traditional way just make sure you connect to it, not to MySQL.