I thought of that over the weekend and gave it a try. I converted all NULL values in one of those columns to empty strings, added the column back into my index and go that same error: "sql_range_query: ERROR: index 0 out of valid range, 0..-1 CONTEXT: PL/pgSQL function "crc32" line 10 at assignment"
However, when I filled them with an arbitrary, non-empty string value the indexing succeeded. So the CRC is failing on NULL values but also on empty strings in Postgres. I suppose I can think of some default value for those rows, but I'd love to have the CRC function not fail on NULL values. If I felt qualified to tackle that I would give it a try, but I'm definitely a noob when it comes to sphinx. On Nov 5, 4:15 pm, Pat Allan <[email protected]> wrote: > Hi Matt > > What are the values in the columns you want to facet? Is there anything > particularly odd? I'm wondering if NULL values are failing in CRC > conversion... if there are NULL values in audience_type, author_type or > format, perhaps try changing them to blank strings? > > Cheers > > -- > Pat > > On 06/11/2010, at 5:19 AM, crazy_matt wrote: > > > Interesting. I have no IDs with a value of 0. As I mentioned, when I > > remove the three columns I was trying to facet on, the indexing > > succeeded. It has something to do with the CRCs for the facted > > columns. > > > On Nov 5, 12:13 pm, Luciano Sousa <[email protected]> wrote: > >> if you have some id 0 in your table, the sphinx can not index it, so you > >> will not have the sphinx functioning properly. I believe this is your > >> problem. > >> I had a similar problem and removed all the values id = 0 in my database. > > >> 2010/11/5 crazy_matt <[email protected]> > > >>> When I remove the faceted fields, the indexing job runs just fine. But > >>> I kinda wanna get those working. > > >>> On Nov 5, 11:40 am, crazy_matt <[email protected]> wrote: > >>>> Obviously. That is why I'm confused about this error. The TS-generated > >>>> SQL looks like this: > > >>>> sql_query = SELECT "books"."id" * 2 + 0 AS "id" , "books"."title" AS > >>>> "title", "books"."subtitle" AS "subtitle", "books"."keywords" AS > >>>> "keywords", "books"."pub_year" AS "pub_year", "books"."id" AS > >>>> "sphinx_internal_id", 1809255439 AS "class_crc", 0 AS > >>>> "sphinx_deleted", COALESCE("books"."title", '') AS "title_sort", > >>>> COALESCE("books"."audience_type", '') AS "audience_type", > >>>> crc32("books"."audience_type") AS "audience_type_facet", > >>>> COALESCE("books"."author_type", '') AS "author_type", > >>>> crc32("books"."author_type") AS "author_type_facet", > >>>> COALESCE("books"."format", '') AS "format", crc32("books"."format") AS > >>>> "format_facet" FROM "books" WHERE ("books"."id" >= $start > >>>> AND "books"."id" <= $end) GROUP BY "books"."id", "books"."title", > >>>> "books"."subtitle", "books"."keywords", "books"."pub_year", > >>>> "books"."id", "books"."title", "books"."audience_type", > >>>> "books"."audience_type", "books"."author_type", "books"."author_type", > >>>> "books"."format", "books"."format" > > >>>> On Nov 5, 11:17 am, Luciano Sousa <[email protected]> wrote: > > >>>>> tables are not indexed with id = 0 > > >>>>> 2010/11/5 crazy_matt <[email protected]> > > >>>>>> I keep getting the following error when I index: > > >>>>>> ERROR: index 'book_core': sql_range_query: ERROR: index 0 out of > >>>>>> valid range, 0..-1 > >>>>>> CONTEXT: PL/pgSQL function "crc32" line 10 at assignment > > >>>>>> The only information I could find about the index out of range error > >>>>>> was for IDs that were enormous. I'm at a loss. Any ideas what may be > >>>>>> causing this? > > >>>>>> Matt > > >>>>>> -- > >>>>>> 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]<thinking-sphinx%[email protected]> > >>> <thinking-sphinx%[email protected]<thinking-sphinx%[email protected]> > > >>>>>> . > >>>>>> For more options, visit this group at > >>>>>>http://groups.google.com/group/thinking-sphinx?hl=en. > > >>>>> -- > >>>>> att: Luciano Sousahttp://www.lucianosousa.net > >>>>> <http://www.lucianosousa.net>http://twitter.com/lucianosousa > >>>>> *Ruby on Rails Developer > >>>>> *Linux User #456387 > >>>>> *Contato: (21) 7639-5049 > > >>> -- > >>> 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]<thinking-sphinx%[email protected]> > >>> . > >>> For more options, visit this group at > >>>http://groups.google.com/group/thinking-sphinx?hl=en. > > >> -- > >> att: Luciano Sousahttp://www.lucianosousa.net > >> <http://www.lucianosousa.net>http://twitter.com/lucianosousa > >> *Ruby on Rails Developer > >> *Linux User #456387 > >> *Contato: (21) 7639-5049 > > > -- > > 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 > > athttp://groups.google.com/group/thinking-sphinx?hl=en. > > -- 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.
