You need to run this command in your shell, not in script/console.
--
Pat
On 16/11/2011, at 8:37 PM, Benjamin Zumhagen wrote:
> This is what I get when I run that command.
>
> irb(main):006:0> search --config config/development.sphinx.conf -i
> hardware_delta dell
> SyntaxError: (irb):6: syntax error, unexpected tIDENTIFIER, expecting
> keyword_do or '{' or '('
> search --config config/development.sphinx.conf -i hardware_delta dell
> ^
> (irb):6: syntax error, unexpected tUMINUS, expecting $end
> search --config config/development.sphinx.conf -i hardware_delta dell
> ^
> from
> C:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in
> `start'
> from
> C:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in
> `start'
> from
> C:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:23:in
> `<top (required)>'
> from script/rails:6:in `require'
> from script/rails:6:in `<main>'
>
> On Wed, Nov 16, 2011 at 5:36 AM, Pat Allan <[email protected]> wrote:
> I'm afraid I don't know what the cause of the problem is here… it looks like
> you don't even have 20 records, so it's not a matter of pagination getting in
> the way… the delta processing happens, the new record seems to be recorded in
> it.
>
> What happens if you run - from the command line - a manual search:
> search --config config/development.sphinx.conf -i hardware_delta dell
>
> Does it get returned?
>
> --
> Pat
>
> On 14/11/2011, at 8:34 PM, Strafe wrote:
>
> > Creating Record
> >
> > irb(main):003:0> Hardware.create(:equipment_manufacturer =>
> > "Dell", :equipment_model => "1337", :serial_number => "12345678")
> > Sphinx 2.0.1-beta (r2792)
> > Copyright (c) 2001-2011, Andrew Aksyonoff
> > Copyright (c) 2008-2011, Sphinx Technologies Inc (http://
> > sphinxsearch.com)
> >
> > using config file 'C:/ruby192/project/config/
> > development.sphinx.conf'...
> > indexing index 'hardware_delta'...
> > WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14592 kb
> > collected 1 docs, 0.0 MB
> > sorted 0.0 Mhits, 100.0% done
> > total 1 docs, 16 bytes
> > total 0.029 sec, 551 bytes/sec, 34.46 docs/sec
> > total 2 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
> > total 9 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
> > rotating indices: succesfully sent SIGHUP to searchd (pid=7588).
> > => #<Hardware id: 11, equipment_model: "1337", serial_number:
> > "12345678", equipment_building: nil, equipment_loca
> > tion: nil, delta: true, created_at: "2011-11-14 13:20:37", updated_at:
> > "2011-11-14 13:20:37", equipment_manufacturer: "Dell">
> >
> > Then I run a Hardware.search with no parameters and it doesnt show up.
> >
> >
> >
> > On Nov 11, 7:11 am, Pat Allan <[email protected]> wrote:
> >> If you have deltas defined, then the indexing should happen already - you
> >> don't need to run define_indexes or index_delta.
> >>
> >> Can you show us what data you're using in the new record, and what your
> >> test search query is?
> >>
> >> --
> >> Pat
> >>
> >> On 11/11/2011, at 12:43 AM, Strafe wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>> Step 1. I have premade records which are indexed initially.
> >>
> >>> irb(main):001:0> Hardware.last
> >>> => #<Hardware id: 3, [...] delta: false >
> >>
> >>> Step 2. I create a new record
> >>
> >>> irb(main):001:0> Hardware.last
> >>> => #<Hardware id: 4, [...] delta: true >
> >>
> >>> Step 3. I checked for defined indexes
> >>
> >>> irb(main):003:0> Hardware.define_indexes
> >>> => true
> >>
> >>> Step 4. I check out delta index
> >>
> >>> irb(main):004:0> Hardware.index_delta
> >>> Sphinx 2.0.1-beta (r2792)
> >>> Copyright (c) 2001-2011, Andrew Aksyonoff
> >>> Copyright (c) 2008-2011, Sphinx Technologies Inc (http://
> >>> sphinxsearch.com)
> >>
> >>> using config file 'C:/ruby192/cec_inventory/config/
> >>> development.sphinx.conf'...
> >>> indexing index 'hardware_delta'...
> >>> WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14592 kb
> >>> collected 1 docs, 0.0 MB
> >>> sorted 0.0 Mhits, 100.0% done
> >>> total 1 docs, 18 bytes
> >>> total 0.060 sec, 295 bytes/sec, 16.44 docs/sec
> >>> total 2 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
> >>> total 9 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
> >>> rotating indices: succesfully sent SIGHUP to searchd (pid=1824).
> >>> => [#<ThinkingSphinx::Deltas::DefaultDelta:0x414b910 [........] ]
> >>
> >>> Here is my define index block
> >>
> >>> define_index do
> >>> # fields
> >>> indexes equipment_manufacturer, :sortable => true
> >>> indexes equipment_model, :sortable => true
> >>> indexes serial_number
> >>> indexes equipment_building
> >>> indexes equipment_location
> >>
> >>> set_property :delta => true
> >>> has created_at, updated_at
> >>> end
> >>
> >>> Let me know if you need anything else.
> >>
> >>> On Nov 9, 9:58 pm, Pat Allan <[email protected]> wrote:
> >>>> Hi
> >>
> >>>> Could you run us through how you're testing the deltas in the command
> >>>> line? It's worth noting that Sphinx takes a second to load the new data,
> >>>> so don't run a search *straight* after creating a new object - I usually
> >>>> use `sleep 0.5` in my tests to account for this.
> >>
> >>>> Also, can you provide the full define_index block?
> >>
> >>>> Cheers
> >>
> >>>> --
> >>>> Pat
> >>
> >>>> On 10/11/2011, at 4:22 AM, Strafe wrote:
> >>
> >>>>> I know this has been covered before, but I couldn't find something in
> >>>>> the other documents which helped me, so I thought i'd make a thread
> >>>>> here.
> >>
> >>>>> So im running Rails 3.0.9 on Ruby 1.9.2.
> >>
> >>>>> Thinking Sphinx worked great, then I decided I wanted to implement
> >>>>> Delta Indexes.
> >>
> >>>>> So I added the column to my model
> >>
> >>>>> :delta, :boolean, :default => true, :null => false
> >>
> >>>>> Then I added the property to my model
> >>
> >>>>> define_index do
> >>>>> set_property :delta => true
> >>>>> end
> >>
> >>>>> Then I ran my migrations
> >>
> >>>>> Then I ran a rake ts:rebuild
> >>
> >>>>> Started my rails server, and everything seemed to be working.
> >>
> >>>>> However, when I create or destroy objects they do not appear in the
> >>>>> search.
> >>
> >>>>> It would seem that everything is working fine, the delta index is in
> >>>>> the model, it's set to true when I create a record. I see the Sphinx
> >>>>> stuff in the console without errors when I create a record.
> >>
> >>>>> And when I run the index_delta command in the IRB it seems to find all
> >>>>> the new records.
> >>
> >>>>>> Hardware.index_delta
> >>>>> Sphinx 2.0.1-beta (r2792)
> >>>>> Copyright (c) 2001-2011, Andrew Aksyonoff
> >>>>> Copyright (c) 2008-2011, Sphinx Technologies Inc (http://
> >>>>> sphinxsearch.com)
> >>
> >>>>> using config file 'C:/ruby192/cec_inventory/config/
> >>>>> development.sphinx.conf'...
> >>>>> indexing index 'hardware_delta'...
> >>>>> WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14592 kb
> >>>>> collected 2 docs, 0.0 MB
> >>>>> sorted 0.0 Mhits, 100.0% done
> >>>>> total 2 docs, 31 bytes
> >>>>> total 0.038 sec, 803 bytes/sec, 51.86 docs/sec
> >>>>> total 2 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
> >>>>> total 9 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
> >>>>> rotating indices: succesfully sent SIGHUP to searchd (pid=7772).
> >>>>> [delta index stuff here]
> >>
> >>>>> Even if i run a ts:reindex when the searchd is running, it doesnt find
> >>>>> the new records, it only set's their delta to false. They don't show
> >>>>> up. The only way I can get them to show is if I run a ts:rebuild.
> >>
> >>>>> Can you guys help me? Sorry If i accidentally left out some details.
> >>
> >>>>> --
> >>>>> 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
> >>> 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.
> >
>
> --
> 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.
>
>
>
> --
> 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.
--
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.