Giter Site home page Giter Site logo

Comments (23)

alindeman avatar alindeman commented on July 22, 2024

Did you add any documents to Solr other than through Sunspot?

from sunspot.

tcocca avatar tcocca commented on July 22, 2024

Nope, sunpot only.

Also, all of these records that were created were through the typical request lifecycle, no console or rake tasks or anything.

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

Are you able to use a debugger to see what raw_hit['id'] is set to when it bombs out (set a breakpoint on hit.rb:30)? Or temporary edit your version of the Sunspot source to output it? It'd be really nice to see what it is .. and therefore work back to how it got that way.

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

Any ideas here? Can you get it down to a representative example with example data?

from sunspot.

tcocca avatar tcocca commented on July 22, 2024

Sorry Andy, I have been deep in a rails3 upgrade for our app for the last
week and a half, just deployed and dealing with a few issues. I'll try to
override that method tomorrow and get some logging in place to try and
figure out what the raw hit is looking like.

~ Tom

On Wed, Nov 9, 2011 at 10:37 AM, Andy Lindeman <
[email protected]>wrote:

Any ideas here? Can you get it down to a representative example with
example data?


Reply to this email directly or view it on GitHub:
#112 (comment)

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

Thanks! 👍

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

We talked through this on IRC. Figured out that a callback was indexing the record before it had an ID.

from sunspot.

aakashd avatar aakashd commented on July 22, 2024

@alindeman How did you solve this issue? I am also facing a similar issue with Sunspot 1.3.3

from sunspot.

alexandremcosta avatar alexandremcosta commented on July 22, 2024

@alindeman IRC?? Are you kidding? Why didn't you post the solution man??, I'm dealing with the same issue, and this is the only place on the web which talks about it. IRC???

undefined method match' for nil:NilClass sunspot (1.3.3) lib/sunspot/search/hit.rb:30:ininitialize'

Backtrace:

sunspot (1.3.3) lib/sunspot/search/hit.rb:30:in initialize' sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:87:innew'
sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:87:in block in hits' sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:86:inmap'
sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:86:in hits' sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:275:inverified_hits'
sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:59:in `results'

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

I posted the issue: "Figured out that a callback was indexing the record before it had an ID."

from sunspot.

theo-bittencourt avatar theo-bittencourt commented on July 22, 2024

+1

from sunspot.

VitorHP avatar VitorHP commented on July 22, 2024

+1

from sunspot.

oddlyfunctional avatar oddlyfunctional commented on July 22, 2024

How did you find out? I have a similar problem, but I can't figure out what's happening. Some queries work normally, so I don't think it's a indexing problem.
The difference is that the error I get is "undefined method `match' for nil:NilClass:", on the same line.

from sunspot.

Jaco-Pretorius avatar Jaco-Pretorius commented on July 22, 2024

I was having the same issue and managed to resolve it. In my case I was explicitly indexing an object before it was saved, by using 'Sunspot.index your_document'. I tracked it down by opening up the sunspot gem (bundle open sunspot) and adding a puts statement to the first line of the hit class initializer. Just being able to see what 'raw_hit' was allowed me to track down the problem - very messy, but effective.

from sunspot.

ma2kubo avatar ma2kubo commented on July 22, 2024

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: Jaco Pretorius <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>
Subject: Re: [sunspot] Issue with hits having something that is nil relating to the raw id (#112)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

from sunspot.

rwd avatar rwd commented on July 22, 2024

I encountered this issue with Sunspot 2.1.0, for the same reason explained by others above, i.e. an object had been indexed even though it had not been saved by ActiveRecord.

The solution to remove this record from the Solr index, without a full reindex, was to run:

Sunspot.remove_by_id!('Post', nil)

... where "Post" is the name of the class indexed by Sunspot.

from sunspot.

ma2kubo avatar ma2kubo commented on July 22, 2024

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: Richard Doe <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>; ma2kubo <[email protected]>
Subject: Re: [sunspot] Issue with hits having something that is nil relating to the raw id (#112)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

from sunspot.

karmajunkie avatar karmajunkie commented on July 22, 2024

Can I read this thread to confirm that Sunspot can't read documents indexed outside of sunspot?

from sunspot.

ma2kubo avatar ma2kubo commented on July 22, 2024

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: Keith Gaddis <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>; ma2kubo <[email protected]>
Subject: Re: [sunspot] Issue with hits having something that is nil relating to the raw id (#112)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

from sunspot.

njakobsen avatar njakobsen commented on July 22, 2024

@karmajunkie Sunspot instantiates activerecord models from the indexed solr records. If the solr contains an record for a model that doesn't existing in activerecord, you will not see it in your list of results.

from sunspot.

ma2kubo avatar ma2kubo commented on July 22, 2024

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: Nicholas Jakobsen <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>; ma2kubo <[email protected]>
Subject: Re: [sunspot] Issue with hits having something that is nil relating to the raw id (#112)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

from sunspot.

pacuna avatar pacuna commented on July 22, 2024

@rwd that solved the problem for me. Thanks!

from sunspot.

sahild avatar sahild commented on July 22, 2024

this fixed it for me:
SolrUtils.clean_index_orphans ModelName

from sunspot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.