Comments (23)
Did you add any documents to Solr other than through Sunspot?
from sunspot.
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.
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.
Any ideas here? Can you get it down to a representative example with example data?
from sunspot.
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.
Thanks! 👍
from sunspot.
We talked through this on IRC. Figured out that a callback was indexing the record before it had an ID.
from sunspot.
@alindeman How did you solve this issue? I am also facing a similar issue with Sunspot 1.3.3
from sunspot.
@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:in
initialize'
Backtrace:
sunspot (1.3.3) lib/sunspot/search/hit.rb:30:in initialize' sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:87:in
new'
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:in
map'
sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:86:in hits' sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:275:in
verified_hits'
sunspot (1.3.3) lib/sunspot/search/abstract_search.rb:59:in `results'
from sunspot.
I posted the issue: "Figured out that a callback was indexing the record before it had an ID."
from sunspot.
+1
from sunspot.
+1
from sunspot.
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.
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.
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.
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.
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.
Can I read this thread to confirm that Sunspot can't read documents indexed outside of sunspot?
from sunspot.
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.
@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.
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.
@rwd that solved the problem for me. Thanks!
from sunspot.
this fixed it for me:
SolrUtils.clean_index_orphans ModelName
from sunspot.
Related Issues (20)
- index not working with Ruby 3 HOT 4
- sunspot:solr:reindex not work after updating rails 6 HOT 1
- Fulltext and Scalar field search is not working with any_of
- sunspot_rails gem bump? HOT 6
- Can't make it work with Solr 8 with docker HOT 1
- Index-time Boosts not supported by Lucene 7 and Solr 8 anymore
- Sunspot RSolr Reindex Error ConnectionRefused After reindexing 99.57% of the model how to continue from where it failed
- Score boost does not work with join fields
- Retry5xxSessionProxy#rescued_exception unused
- DEPRECATION: Rsolr.new/connect option 'read_timeout' is deprecated and will be removed in Rsolr 3.
- Not able to reindexing restored couchdb HOT 1
- Search by exact match on text field is not working as expected HOT 1
- Can Opendistro Elasticsearch be used in place of Solr? HOT 1
- Psych::BadAlias in Ruby 3.1 configuration
- NoMethodError on Ruby 3.2 for `File.exists?` HOT 8
- sort param could not be parsed as a query, and is not a field that exists in the index: geodist(location_ll,32.8563846,-117.2029363)
- How to stub results?
- Is this available with Solr 9? HOT 2
- Rails 7.1 deprecation warning HOT 1
- Discussion: Is this project dead? (aka: is this now a joke?) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sunspot.