It turns out it wasn't doing it right sometimes and wrong sometimes, I
was just seeing things.
The only way I got the indexes to generate without ".new" in the name
was to cut and paste my Ultrasphinx-generated conf headers into
development.sphinx .conf.
Which led me to create a sphinx.yml file.
I need the star functionality though. So given yaml entry:
development:
read_timeout: 5
max_children: 300
port: 3312
max_matches: 1000
pid_file: /home/sphinx/log/searchd.pid
query_log_file: /home/sphinx/log/query.log
searchd_log_file: /home/sphinx/log/searchd.log
searchd_file_path: /home/sphinx/development/
mem_limit: 256M
min_prefix_len: 2
allow_star: true
seamless_rotate: 1
address: 127.0.0.1
I'm getting a conf of:
source 13490_description_core_0
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass = iware1pr
sql_db = c13490
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query = SELECT `descriptions`.`id` * 5 + 0 AS `id` , CAST
(`descriptions`.`long_description` AS CHAR) AS `long_description`, CAST
(`descriptions`.`aaia_part_description` AS CHAR) AS
`aaia_part_description`, UNIX_TIMESTAMP(`descriptions`.`created_at`)
AS `created_at`, UNIX_TIMESTAMP(`descriptions`.`updated_at`) AS
`updated_at`, `descriptions`.`id` AS `sphinx_internal_id`, 3950563313
AS `class_crc`, '3950563313' AS `subclass_crcs`, 0 AS `sphinx_deleted`
FROM descriptions WHERE `descriptions`.`id` >= $start AND
`descriptions`.`id` <= $end GROUP BY `descriptions`.`id` ORDER BY
NULL
sql_query_range = SELECT IFNULL(MIN(`id`), 1), IFNULL(MAX(`id`), 1)
FROM `descriptions`
sql_attr_uint = sphinx_internal_id
sql_attr_uint = class_crc
sql_attr_uint = sphinx_deleted
sql_attr_timestamp = created_at
sql_attr_timestamp = updated_at
sql_attr_multi = uint subclass_crcs from field
sql_query_info = SELECT * FROM `descriptions` WHERE `id` = (($id -
0) / 5)
}
index 13490_description_core
{
source = 13490_description_core_0
path = /home/sphinx/development/13490_description_core
morphology = stem_en
charset_type = utf-8
min_prefix_len = 1
enable_star = true
}
index 13490_description
{
type = distributed
local = 13490_description_core
}
But, when I run the indexer with "rake ts:in", indexes don't
generate. Instead, I get:
superion:/Library/myco/code/myapp $ sudo rake ts:in
(in /Library/myco/code/myapp)
indexer --config /Library/myco/code/myapp/config/
development.sphinx.conf --all
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff
using config file '/Library/myco/code/myapp/config/
development.sphinx.conf'...
indexing index '13490_description_core'...
ERROR: index '13490_description_core': infixes and morphology are
enabled, enable_star=0distributed index '13490_description' can not be
directly indexed; skipping.
It makes no attempt to index whatsoever. If I remove allow_star,
reconfigure, and index again, I get:
using config file '/Library/myco/code/myapp/config/
development.sphinx.conf'...
indexing index '13490_description_core'...
collected 3417 docs, 0.1 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 3417 docs, 104286 bytes
total 0.077 sec, 1347103.38 bytes/sec, 44138.73 docs/sec
distributed index '13490_description' can not be directly indexed;
skipping.
I wonder why Sphinx isn't indexing properly on allow_star?
On Apr 11, 10:29 pm, Pat Allan <[email protected]> wrote:
> Not entirely sure why it's sometimes doing it right, and sometimes
> doing it wrong, but it looks like you've got Sphinx running - and if
> that's the case, the indexer task assumes that every index it
> generates, it's replacing an existing one.
>
> Try stopping Sphinx, deleting those files, re-indexing, then
> restarting Sphinx. And don't forget to stop Sphinx if you're ever
> adding or removing an index.
>
> --
> Pat
>
> On 12/04/2009, at 12:00 PM, migrating_from_ultrasphinx wrote:
>
>
>
> > Let me preface this by first stating that I have an application that
> > has user data in separate database. Each user has his own database.
> > So I have hacked TS in it's configure and search code to generate
> > index configs for each user.
>
> > Having said that, running the ts:in task, which apparently just runs
> > config and the Sphinx indexer, I get index files that look like this:
>
> > ** Note, that "14014" is our user's account number, which specifies
> > the db being indexed.
>
> > -rw-r--r-- 1 root admin 791 Apr 11 21:40
> > 14014_product_core.new.spp
> > -rw-r--r-- 1 root admin 4740 Apr 11 21:40
> > 14014_product_core.new.spm
> > -rw-r--r-- 1 root admin 2709 Apr 11 21:40
> > 14014_product_core.new.spi
> > -rw-r--r-- 1 root admin 325 Apr 11 21:40
> > 14014_product_core.new.sph
> > -rw-r--r-- 1 root admin 2673 Apr 11 21:40
> > 14014_product_core.new.spd
> > -rw-r--r-- 1 root admin 12640 Apr 11 21:40
> > 14014_product_core.new.spa
>
> > Where is that ".new" coming from?
>
> > And of course when I run ts:start, it complains that it can't find the
> > indexes in the config file. Here's the config:
>
> > source 14014_product_core_0
> > {
> > type = mysql
> > sql_host = localhost
> > sql_user = root
> > sql_pass = iware1pr
> > sql_db = c14014
> > sql_port = 3306
> > sql_query_pre = SET NAMES utf8
> > sql_query = SELECT `products`.`id` * 5 + 3 AS `id` , CAST
> > (`products`.`part_number` AS CHAR) AS `part_number`, IFNULL
> > (`products`.`part_number`, '') AS `part_number_sort`, UNIX_TIMESTAMP
> > (`products`.`created_at`) AS `created_at`, UNIX_TIMESTAMP
> > (`products`.`updated_at`) AS `updated_at`, `products`.`id` AS
> > `sphinx_internal_id`, 485965105 AS `class_crc`, '485965105' AS
> > `subclass_crcs`, 0 AS `sphinx_deleted` FROM products WHERE
> > `products`.`id` >= $start AND `products`.`id` <= $end GROUP BY
> > `products`.`id` ORDER BY NULL
> > sql_query_range = SELECT IFNULL(MIN(`id`), 1), IFNULL(MAX(`id`), 1)
> > FROM `products`
> > sql_attr_uint = sphinx_internal_id
> > sql_attr_uint = class_crc
> > sql_attr_uint = sphinx_deleted
> > sql_attr_timestamp = created_at
> > sql_attr_timestamp = updated_at
> > sql_attr_str2ordinal = part_number_sort
> > sql_attr_multi = uint subclass_crcs from field
> > sql_query_info = SELECT * FROM `products` WHERE `id` = (($id - 3) /
> > 5)
> > }
>
> > index 14014_product_core
> > {
> > source = 14014_product_core_0
> > path = /home/sphinx/sphinx/development/14014_product_core
> > morphology = stem_en
> > charset_type = utf-8
> > }
>
> > index 14014_product
> > {
> > type = distributed
> > local = 14014_product_core
> > }
>
> > Here's the crazy thing though. If I run config for just ONE account,
> > the index file names are generated correctly.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---