anonymous user

Forums   Register   Login   Forgot your login/password?   Search

How to get results based on their matching ?

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 519 | 520 | 521 | 522 | next »» | Create new thread

shantha

Name: shantha
Posts: 2

2011-11-02 14:11:41 | reply!


Hi, I'm newbie here.

I want to get result from search which fulfill following requirements.

When I search for three words like "public work place".
I want to get the result which following order in the result items.
1. have all three words as a phrase
2. then any match
3. the wild-card match ("*public* *work* *places*")

Can this be done with Sphinx?

Thanks and regards,
Shantha.

barryhunter

Name: Barry Hunter
Posts: 7343

to: shantha, 2011-11-02 14:16:08 | reply!


$cl->setMatchMode(SPH_MATCH_EXTENDED);
$cl->setRankMode(SPH_RANK_WORDCOUNT);

$cl->Query('"public work place" | (public work place) | "public work place"/1 | (*public*
*work* *place*)',$index);



(using min_index_len and enable_star in your index config)

shantha

Name: shantha
Posts: 2

to: barryhunter, 2011-11-03 05:51:12 | reply!


Thanks a lot for the immediate reply and this is a big help.

Thanks and regards,
Shantha.

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 519 | 520 | 521 | 522 | next »» | Create new thread