anonymous user

Forums   Register   Login   Forgot your login/password?   Search

How to search on this table design

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 451 | 452 | 453 | 454 | next »» | Create new thread

asmith

Name: Alex
Posts: 1

2012-08-04 07:35:16 | reply!


Hello,

I'm very new to this but I've setup sphinx successfully and I'm getting results.
However, I have a sports_games table which stores games played about 200k rows and
another table sports_games_players which ties players participated to each game. it has
over a million rows. Each id_game could have 2 to 8 players assigned to it. Something
like this:

sports_games:
id_game time_played info_on_game ...

sports_games_players:
id_game id_player is_winner ...


So I'd like to find games which specific players have participated together. A simple
inner join between these two tables will produce rows for each player. To find a game
which 2 players have participated, I need 2 inner joins to and check id_players, but
since each game could have 2 to 8 players assigned to it, I can't have fixed number of
joins.

Is it possible to achieve this with sphinx?

anteater_sa

Posts: 7

to: asmith, 2012-08-10 12:04:42 | reply!


Hi, you need to look at adding the id_player to the sphinx index for sport games using
the MVA (Multi Value Attribute), this allows you to associate multiple players with a
single game and then filter games by player ids.

read more here:

http://sphinxsearch.com/docs/2.0.5/mva.html
http://sphinxsearch.com/docs/2.0.5/conf-sql-attr-multi.html

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 451 | 452 | 453 | 454 | next »» | Create new thread