I'm having a weird issue, hopefully someone else has a fix for it.  I
think I figured this out while typing this message, but I'll post it
anyway as google fodder, or if I turn out to be wrong, or if there is
a way to solve this with TS config.

I'm trying to setup some integration tests to verify that sphinx is
indexing/searching as I expect it to (my functional tests already stub
out the sphinx methods).  I setup an integration test class which
starts/indexes TS via the rake tasks before running my tests.  My
harness is working fine, but the indexer hangs while generating the
index.

I've come up with the following facts
1) indexer runs fine with an empty schema (drop/recreate test db, rake
db:test:prepare)
2) indexer only hangs once the test db has been populated from
fixtures.
3) Its not TS that is hanging, running the indexer manually by hand
also causes it to hang with the config generated by TS.
4) I removed all my indexed models but one, and made it as simple as
possible, still hangs
5) Happens with sphinx 0.9.8.1 on either os x or ubuntu linux

Looking at queries executed, I think that the id range from fixtures
is just so large that the indexer takes forever to reach the end:

mysql> SELECT IFNULL(MIN(`pictures`.`id`), 1), IFNULL(MAX
(`pictures`.`id`), 1) FROM `pictures`\G
*************************** 1. row ***************************
IFNULL(MIN(`pictures`.`id`), 1): 12412891
IFNULL(MAX(`pictures`.`id`), 1): 1026141002
1 row in set (0.00 sec)

mysql query log

                     11 Query       SELECT IFNULL(MIN(`id`), 1), IFNULL
(MAX(`id`
), 1) FROM `pictures`
                     11 Query       SELECT `pictures`.`id` * 1 + 0 AS
`id` , CAS
T(`pictures`.`title` AS CHAR) AS `title`, `pictures`.`id` AS
`sphinx_internal_id
`, 3647370773 AS `class_crc`, '3647370773' AS `subclass_crcs`, 0 AS
`sphinx_dele
ted` FROM pictures    WHERE `pictures`.`id` >= 12412891   AND
`pictures`.`id` <=
 12413914    GROUP BY `pictures`.`id`  ORDER BY NULL
                     11 Query       SELECT `pictures`.`id` * 1 + 0 AS
`id` , CAS
T(`pictures`.`title` AS CHAR) AS `title`, `pictures`.`id` AS
`sphinx_internal_id
`, 3647370773 AS `class_crc`, '3647370773' AS `subclass_crcs`, 0 AS
`sphinx_dele
ted` FROM pictures    WHERE `pictures`.`id` >= 12413915   AND
`pictures`.`id` <=
 12414938    GROUP BY `pictures`.`id`  ORDER BY NULL
                     11 Query       SELECT `pictures`.`id` * 1 + 0 AS
`id` , CAS
T(`pictures`.`title` AS CHAR) AS `title`, `pictures`.`id` AS
`sphinx_internal_id
`, 3647370773 AS `class_crc`, '3647370773' AS `subclass_crcs`, 0 AS
`sphinx_dele
ted` FROM pictures    WHERE `pictures`.`id` >= 12414939   AND
`pictures`.`id` <=
 12415962    GROUP BY `pictures`.`id`  ORDER BY NULL

.. and so on

So, is there a way to get fixtures to use more sane IDs, or emos way
to get TS/sphinx to not use the id range in test env?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to