You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dan whelan <da...@adicio.com> on 2011/06/03 17:46:46 UTC
fq null pointer exception
I am noticing something strange with our recent upgrade to solr 3.1 and
want to see if anyone has experienced anything similar.
I have a solr.StrField field named Status the values are Enabled,
Disabled, or ''
When I facet on that field it I get
Enabled 4409565
Disabled 29185
"" 112
The issue is when I do a filter query
This query works
select/?q=*:*&fq=Status:"Enabled"
But when I run this query I get a NPE
select/?q=*:*&fq=Status:"Disabled"
Here is part of the stack trace
Problem accessing /solr/global_accounts/select/. Reason:
null
java.lang.NullPointerException
at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
at org.apache.solr.schema.StrField.write(StrField.java:49)
at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
at org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
at
org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
at org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
at
org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
...
Thanks,
Dan
Re: fq null pointer exception
Posted by Yonik Seeley <yo...@lucidimagination.com>.
Dan, this doesn't really have anything to do with your filter on the
Status field except that it causes different documents to be selected.
The root cause is a schema mismatch with your index.
A string field (or so the schema is saying it's a string field) is
returning "null" for a value, which is impossible (null values aren't
stored... they are simply missing).
This can happen when the field is actually stored as binary (as is the
case for numeric fields). So my guess is that a field that was
previously a numeric field is now declared to be of type string by the
current schema.
You can try varying the "fl" parameter to see what field is causing
the issue, or try luke or the luke request handler for a lower-level
view of the index.
-Yonik
http://www.lucidimagination.com
On Fri, Jun 3, 2011 at 11:46 AM, dan whelan <da...@adicio.com> wrote:
> I am noticing something strange with our recent upgrade to solr 3.1 and want
> to see if anyone has experienced anything similar.
>
> I have a solr.StrField field named Status the values are Enabled, Disabled,
> or ''
>
> When I facet on that field it I get
>
> Enabled 4409565
> Disabled 29185
> "" 112
>
>
> The issue is when I do a filter query
>
> This query works
>
> select/?q=*:*&fq=Status:"Enabled"
>
> But when I run this query I get a NPE
>
> select/?q=*:*&fq=Status:"Disabled"
>
>
> Here is part of the stack trace
>
>
> Problem accessing /solr/global_accounts/select/. Reason:
> null
>
> java.lang.NullPointerException
> at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
> at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
> at org.apache.solr.schema.StrField.write(StrField.java:49)
> at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
> at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
> at org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
> at org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
> at org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
> at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
> at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
> at
> org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
> ...
>
>
> Thanks,
>
> Dan
>
>
Re: fq null pointer exception
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Right, so now try adding different fields and see which one breaks it again.
Then you know which field is a problem and you can dig deeper around that field.
Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/
----- Original Message ----
> From: dan whelan <da...@adicio.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, June 3, 2011 4:34:40 PM
> Subject: Re: fq null pointer exception
>
> It returned results when I added the fl param.
>
> Strange... wonder what is going on there
>
> Thanks,
>
> Dan
>
>
>
> On 6/3/11 12:17 PM, Otis Gospodnetic wrote:
> > And what happens if you add&fl=<your id field here>?
> >
> > Otis
> > ----
> > Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> > Lucene ecosystem search :: http://search-lucene.com/
> >
> >
> >
> > ----- Original Message ----
> >> From: dan whelan<da...@adicio.com>
> >> To: solr-user@lucene.apache.org
> >> Sent: Fri, June 3, 2011 1:38:33 PM
> >> Subject: Re: fq null pointer exception
> >>
> >> Otis, I just deleted the documents and committed and I still get that
>error.
> >>
> >> Thanks,
> >>
> >> Dan
> >>
> >>
> >> On 6/3/11 9:43 AM, Otis Gospodnetic wrote:
> >>> Dan, does the problem go away if you get rid of those 112 documents with
> >> empty
> >>> Status or replace their empty status value with, say, "Unknown"?
> >>>
> >>> Otis
> >>> ----
> >>> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> >>> Lucene ecosystem search :: http://search-lucene.com/
> >>>
> >>>
> >>>
> >>> ----- Original Message ----
> >>>> From: dan whelan<da...@adicio.com>
> >>>> To: solr-user@lucene.apache.org
> >>>> Sent: Fri, June 3, 2011 11:46:46 AM
> >>>> Subject: fq null pointer exception
> >>>>
> >>>> I am noticing something strange with our recent upgrade to solr 3.1 and
> >> want to
> >>>> see if anyone has experienced anything similar.
> >>>>
> >>>> I have a solr.StrField field named Status the values are Enabled,
> >> Disabled, or
> >>>> ''
> >>>>
> >>>> When I facet on that field it I get
> >>>>
> >>>> Enabled 4409565
> >>>> Disabled 29185
> >>>> "" 112
> >>>>
> >>>>
> >>>> The issue is when I do a filter query
> >>>>
> >>>> This query works
> >>>>
> >>>> select/?q=*:*&fq=Status:"Enabled"
> >>>>
> >>>> But when I run this query I get a NPE
> >>>>
> >>>> select/?q=*:*&fq=Status:"Disabled"
> >>>>
> >>>>
> >>>> Here is part of the stack trace
> >>>>
> >>>>
> >>>> Problem accessing /solr/global_accounts/select/. Reason:
> >>>> null
> >>>>
> >>>> java.lang.NullPointerException
> >>>> at
>org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
> >>>> at
>org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
> >>>> at org.apache.solr.schema.StrField.write(StrField.java:49)
> >>>> at
>org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
> >>>> at
>org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
> >>>> at
> >> org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
> >>>> at
> >> org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
> >>>> at
> >> org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
> >>>> at
>org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
> >>>> at
> >> org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
> >>>> at
> >>>>
> > org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
> >>>> ...
> >>>>
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Dan
> >>>>
> >>>>
> >>
>
>
Re: fq null pointer exception
Posted by dan whelan <da...@adicio.com>.
It returned results when I added the fl param.
Strange... wonder what is going on there
Thanks,
Dan
On 6/3/11 12:17 PM, Otis Gospodnetic wrote:
> And what happens if you add&fl=<your id field here>?
>
> Otis
> ----
> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> Lucene ecosystem search :: http://search-lucene.com/
>
>
>
> ----- Original Message ----
>> From: dan whelan<da...@adicio.com>
>> To: solr-user@lucene.apache.org
>> Sent: Fri, June 3, 2011 1:38:33 PM
>> Subject: Re: fq null pointer exception
>>
>> Otis, I just deleted the documents and committed and I still get that error.
>>
>> Thanks,
>>
>> Dan
>>
>>
>> On 6/3/11 9:43 AM, Otis Gospodnetic wrote:
>>> Dan, does the problem go away if you get rid of those 112 documents with
>> empty
>>> Status or replace their empty status value with, say, "Unknown"?
>>>
>>> Otis
>>> ----
>>> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
>>> Lucene ecosystem search :: http://search-lucene.com/
>>>
>>>
>>>
>>> ----- Original Message ----
>>>> From: dan whelan<da...@adicio.com>
>>>> To: solr-user@lucene.apache.org
>>>> Sent: Fri, June 3, 2011 11:46:46 AM
>>>> Subject: fq null pointer exception
>>>>
>>>> I am noticing something strange with our recent upgrade to solr 3.1 and
>> want to
>>>> see if anyone has experienced anything similar.
>>>>
>>>> I have a solr.StrField field named Status the values are Enabled,
>> Disabled, or
>>>> ''
>>>>
>>>> When I facet on that field it I get
>>>>
>>>> Enabled 4409565
>>>> Disabled 29185
>>>> "" 112
>>>>
>>>>
>>>> The issue is when I do a filter query
>>>>
>>>> This query works
>>>>
>>>> select/?q=*:*&fq=Status:"Enabled"
>>>>
>>>> But when I run this query I get a NPE
>>>>
>>>> select/?q=*:*&fq=Status:"Disabled"
>>>>
>>>>
>>>> Here is part of the stack trace
>>>>
>>>>
>>>> Problem accessing /solr/global_accounts/select/. Reason:
>>>> null
>>>>
>>>> java.lang.NullPointerException
>>>> at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
>>>> at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
>>>> at org.apache.solr.schema.StrField.write(StrField.java:49)
>>>> at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
>>>> at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
>>>> at
>> org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
>>>> at
>> org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
>>>> at
>> org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
>>>> at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
>>>> at
>> org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
>>>> at
>>>>
> org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
>>>> ...
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Dan
>>>>
>>>>
>>
Re: fq null pointer exception
Posted by Otis Gospodnetic <ot...@yahoo.com>.
And what happens if you add &fl=<your id field here>?
Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/
----- Original Message ----
> From: dan whelan <da...@adicio.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, June 3, 2011 1:38:33 PM
> Subject: Re: fq null pointer exception
>
> Otis, I just deleted the documents and committed and I still get that error.
>
> Thanks,
>
> Dan
>
>
> On 6/3/11 9:43 AM, Otis Gospodnetic wrote:
> > Dan, does the problem go away if you get rid of those 112 documents with
>empty
> > Status or replace their empty status value with, say, "Unknown"?
> >
> > Otis
> > ----
> > Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> > Lucene ecosystem search :: http://search-lucene.com/
> >
> >
> >
> > ----- Original Message ----
> >> From: dan whelan<da...@adicio.com>
> >> To: solr-user@lucene.apache.org
> >> Sent: Fri, June 3, 2011 11:46:46 AM
> >> Subject: fq null pointer exception
> >>
> >> I am noticing something strange with our recent upgrade to solr 3.1 and
>want to
> >> see if anyone has experienced anything similar.
> >>
> >> I have a solr.StrField field named Status the values are Enabled,
>Disabled, or
> >> ''
> >>
> >> When I facet on that field it I get
> >>
> >> Enabled 4409565
> >> Disabled 29185
> >> "" 112
> >>
> >>
> >> The issue is when I do a filter query
> >>
> >> This query works
> >>
> >> select/?q=*:*&fq=Status:"Enabled"
> >>
> >> But when I run this query I get a NPE
> >>
> >> select/?q=*:*&fq=Status:"Disabled"
> >>
> >>
> >> Here is part of the stack trace
> >>
> >>
> >> Problem accessing /solr/global_accounts/select/. Reason:
> >> null
> >>
> >> java.lang.NullPointerException
> >> at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
> >> at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
> >> at org.apache.solr.schema.StrField.write(StrField.java:49)
> >> at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
> >> at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
> >> at
>org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
> >> at
>org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
> >> at
>org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
> >> at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
> >> at
>org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
> >> at
> >>
org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
> >> ...
> >>
> >>
> >> Thanks,
> >>
> >> Dan
> >>
> >>
>
>
Re: fq null pointer exception
Posted by dan whelan <da...@adicio.com>.
Otis, I just deleted the documents and committed and I still get that error.
Thanks,
Dan
On 6/3/11 9:43 AM, Otis Gospodnetic wrote:
> Dan, does the problem go away if you get rid of those 112 documents with empty
> Status or replace their empty status value with, say, "Unknown"?
>
> Otis
> ----
> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> Lucene ecosystem search :: http://search-lucene.com/
>
>
>
> ----- Original Message ----
>> From: dan whelan<da...@adicio.com>
>> To: solr-user@lucene.apache.org
>> Sent: Fri, June 3, 2011 11:46:46 AM
>> Subject: fq null pointer exception
>>
>> I am noticing something strange with our recent upgrade to solr 3.1 and want to
>> see if anyone has experienced anything similar.
>>
>> I have a solr.StrField field named Status the values are Enabled, Disabled, or
>> ''
>>
>> When I facet on that field it I get
>>
>> Enabled 4409565
>> Disabled 29185
>> "" 112
>>
>>
>> The issue is when I do a filter query
>>
>> This query works
>>
>> select/?q=*:*&fq=Status:"Enabled"
>>
>> But when I run this query I get a NPE
>>
>> select/?q=*:*&fq=Status:"Disabled"
>>
>>
>> Here is part of the stack trace
>>
>>
>> Problem accessing /solr/global_accounts/select/. Reason:
>> null
>>
>> java.lang.NullPointerException
>> at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
>> at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
>> at org.apache.solr.schema.StrField.write(StrField.java:49)
>> at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
>> at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
>> at org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
>> at org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
>> at org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
>> at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
>> at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
>> at
>> org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
>> ...
>>
>>
>> Thanks,
>>
>> Dan
>>
>>
Re: fq null pointer exception
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Dan, does the problem go away if you get rid of those 112 documents with empty
Status or replace their empty status value with, say, "Unknown"?
Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/
----- Original Message ----
> From: dan whelan <da...@adicio.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, June 3, 2011 11:46:46 AM
> Subject: fq null pointer exception
>
> I am noticing something strange with our recent upgrade to solr 3.1 and want to
>see if anyone has experienced anything similar.
>
> I have a solr.StrField field named Status the values are Enabled, Disabled, or
>''
>
> When I facet on that field it I get
>
> Enabled 4409565
> Disabled 29185
> "" 112
>
>
> The issue is when I do a filter query
>
> This query works
>
> select/?q=*:*&fq=Status:"Enabled"
>
> But when I run this query I get a NPE
>
> select/?q=*:*&fq=Status:"Disabled"
>
>
> Here is part of the stack trace
>
>
> Problem accessing /solr/global_accounts/select/. Reason:
> null
>
> java.lang.NullPointerException
> at org.apache.solr.response.XMLWriter.writePrim(XMLWriter.java:828)
> at org.apache.solr.response.XMLWriter.writeStr(XMLWriter.java:686)
> at org.apache.solr.schema.StrField.write(StrField.java:49)
> at org.apache.solr.schema.SchemaField.write(SchemaField.java:125)
> at org.apache.solr.response.XMLWriter.writeDoc(XMLWriter.java:369)
> at org.apache.solr.response.XMLWriter$3.writeDocs(XMLWriter.java:545)
> at org.apache.solr.response.XMLWriter.writeDocuments(XMLWriter.java:482)
> at org.apache.solr.response.XMLWriter.writeDocList(XMLWriter.java:519)
> at org.apache.solr.response.XMLWriter.writeVal(XMLWriter.java:582)
> at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:131)
> at
>org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:35)
> ...
>
>
> Thanks,
>
> Dan
>
>