|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-12-12 11:57 UTC] sergey dot zavg at gmail dot com
Description:
------------
This piece of code in sphinx.c is not working, cause #ifdef does not check enum values definitions.
#ifdef SPH_RANK_PROXIMITY
SPHINX_CONST(SPH_RANK_PROXIMITY);
#endif
#ifdef SPH_RANK_MATCHANY
SPHINX_CONST(SPH_RANK_MATCHANY);
#endif
#ifdef SPH_RANK_FIELDMASK
SPHINX_CONST(SPH_RANK_FIELDMASK);
#endif
#ifdef SPH_RANK_SPH04
SPHINX_CONST(SPH_RANK_SPH04);
#endif
#ifdef SPH_RANK_EXPR
SPHINX_CONST(SPH_RANK_EXPR);
#endif
#ifdef SPH_RANK_TOTAL
SPHINX_CONST(SPH_RANK_TOTAL);
#endif
So the constants SPH_RANK_PROXIMITY, SPH_RANK_MATCHANY, SPH_RANK_FIELDMASK, SPH_RANK_SPH04, SPH_RANK_EXPR, SPH_RANK_TOTAL are anavailable from PHP even if they are defined in enum in sphinxclient.h.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 00:00:02 2025 UTC |
Here is the part of content of my sphinxclinet.h file. /// known ranking modes (ext2 only) enum { SPH_RANK_PROXIMITY_BM25 = 0, SPH_RANK_BM25 = 1, SPH_RANK_NONE = 2, SPH_RANK_WORDCOUNT = 3, SPH_RANK_PROXIMITY = 4, SPH_RANK_MATCHANY = 5, SPH_RANK_FIELDMASK = 6, SPH_RANK_SPH04 = 7, SPH_RANK_EXPR = 8, SPH_RANK_TOTAL = 9, SPH_RANK_DEFAULT = SPH_RANK_PROXIMITY_BM25 }; You can see that SPH_RANK_EXPR is here but #ifdef SPH_RANK_EXPR will not got it. So I have to use $s->setRankingMode($8, "sum(1)"); in my PHP code.