Thanks, Pat! Got it to work!

On Thursday, March 7, 2013 2:22:42 AM UTC-8, Pat Allan wrote:
>
> Hi Sasha
>
> No worries about asking questions - especially since I think I can answer 
> this one :)
>
> It looks like Sphinx on your machine was compiled without support for 
> PostgreSQL. How did you install PostgreSQL? And how did you install Sphinx? 
> If you compiled by hand, Sphinx doesn't automatically add PostgreSQL 
> support - you need to set it with a flag (it's annoying, because I use 
> PostgreSQL all the time too). It's mentioned in the UNIX section of the TS 
> docs briefly:
> http://pat.github.com/ts/en/installing_sphinx.html
>
> From your file paths, I'm guessing you're on OS X - if you installed 
> Sphinx via homebrew, but PostgreSQL from elsewhere (say, Heroku's 
> Postgres.app), then you may need to provide some flags then as well to make 
> sure homebrew detects PostgreSQL successfully.
>
> Cheers
>
> Pat
>
> On 07/03/2013, at 6:30 PM, Sasha Klein wrote:
>
> > Thanks!
> > 
> > Ran into another error once I cleared that one :)
> > 
> > So I moved my index definition and tried running "rake ts:index" again, 
> and got this error:
> > 
> > indexing index 'post_core'...
> > ERROR: source 'post_core_0': unknown type 'pgsql'; skipping.
> > ERROR: index 'post_core': failed to configure some of the sources, will 
> not index.
> > total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
> > total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
> > 
> > Looking around, I saw this was possibly fixed by creating a 
> config/sphinx.yml file and putting:
> > 
> > development:
> >   bin_path: '/usr/local/bin'
> > develpment:
> >   bin_path: '/usr/local/bin'
> > 
> > in it. Ran that and it still didn't work. Then tried "rake 
> ts:configure", and it ran smoothly but still referred to the same 
> config/development.sphinx.conf file, which is now a good deal more full:
> > 
> > indexer
> > {
> > }
> > 
> > searchd
> > {
> >   listen = 127.0.0.1:9306:mysql41
> >   log = 
> /Users/<personal>/rails_projects/<personal>/log/development.searchd.log
> >   query_log = 
> /Users/<personal>/rails_projects/<personal>/log/development.searchd.query.log
> >   pid_file = 
> /Users/<personal>/rails_projects/<personal>/log/development.sphinx.pid
> >   workers = threads
> >   binlog_path = 
> /Users/<personal>/rails_projects/<personal>/tmp/binlog/development
> > }
> > 
> > source post_core_0
> > {
> >   type = pgsql
> >   sql_host = localhost
> >   sql_user = <personal>
> >   sql_pass = 
> >   sql_db = <personal>_development
> >   sql_query = SELECT "posts"."id" * 1 + 0 AS "id", 'Post' AS 
> "sphinx_internal_class_name", "posts"."name" AS "name", "posts"."content" 
> AS "content", "posts"."id" AS "sphinx_internal_id", 'Post' AS 
> "sphinx_internal_class", 0 AS "sphinx_deleted" FROM "posts"  WHERE 
> ("posts"."id" >= $start AND "posts"."id" <= $end) GROUP BY "posts"."id", 
> "posts"."name", "posts"."content", "posts"."id"
> >   sql_query_range = SELECT COALESCE(MIN("posts"."id"), 1), 
> COALESCE(MAX("posts"."id"), 1) FROM "posts" 
> >   sql_attr_uint = sphinx_internal_id
> >   sql_attr_uint = sphinx_deleted
> >   sql_attr_string = sphinx_internal_class
> >   sql_query_info = SELECT "posts".* FROM "posts"  WHERE ("posts"."id" = 
> ($id - 0) / 1)
> > }
> > 
> > index post_core
> > {
> >   path = 
> /Users/<personal>/rails_projects/<personal>/db/sphinx/development/post_core
> >   docinfo = extern
> >   charset_type = utf-8
> >   source = post_core_0
> > }
> > 
> > Any ideas what's happening now? Thanks, and sorry for all the questions.
> > 
> > On Wednesday, March 6, 2013 12:04:17 AM UTC-8, Pat Allan wrote:
> > Hi Sasha
> > The issue is that Thinking Sphinx's documentation is mostly for v2, but 
> v3 is what you're using (and much better). Index definitions are now 
> located in app/indices - the README is your best source of information (but 
> anything it doesn't cover is probably the same as earlier versions):
> > https://github.com/pat/thinking-sphinx/blob/master/README.textile
> > 
> > Have a read through of that, move your index definition, and you should 
> be good to go. Any further issues, get in touch :)
> > 
> > -- 
> > Pat
> > 
> > On 06/03/2013, at 6:12 PM, Sasha Klein wrote:
> > 
> > > Hi,
> > > 
> > > Just installed Thinking Sphinx for my Rails app and have run into the 
> above error. Opened a Stack Overflow post about it, but it doesn't seem to 
> be getting many views/answers. I'll leave the bulk of my code there, where 
> I think it's easier to comb through, but just reiterate the basic problem 
> here.
> > > 
> > > I installed TS and MySQL (already runny development and production on 
> postgresql), then defined indexes for my post model, and went to run "rake 
> ts:index" per the instructions on this Railscast, but I got the error in 
> the subject line.
> > > 
> > > I searched for solutions and ran into this other similar post, but it 
> seems like we have different root causes, as the result of running 
> "Post.sphinx_indexes.length" in the console shows. At any rate, all of this 
> code and some more background is visible in the SO post. 
> > > 
> > > Any ideas what's going on? If you'd rather I post the code here, I can 
> do that as well. Just felt redundant. 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> Groups "Thinking Sphinx" group.
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected].
> > > To post to this group, send email to [email protected].
> > > Visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.
> > > For more options, visit https://groups.google.com/groups/opt_out.
> > >  
> > >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Thinking Sphinx" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>.
> > To post to this group, send email to 
> > [email protected]<javascript:>
> .
> > Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
> >  
> >  
>
>
>

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


Reply via email to