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 Steve Pruitt <bp...@opentext.com> on 2019/06/27 17:36:41 UTC

Solr not returning stored field

I cannot get Solr to return a stored field.

My schema is:

:
<field name="user" type="plong" indexed="true" stored="true"/>
<field name="ranking" type="pdouble" indexed="false" stored="true"/>
<field name="reference" type="string" indexed="false" stored="true"/>
:

I am using the SolrJ client and trying this:

The query string contains = " user: " and a list of user field values;
The query executes ok.  I get several documents.

SolrQuery solrQuery = new SolrQuery(query);
solrQuery.setSort("ranking" , SolrQuery.ORDER.desc);
solrQuery.addField("ranking");
solrQuery.addField("reference");

I also tried:

solrQuery.setFields("ranking", " reference");

But the result has only the "ranking" field.
Before explicitly setting the fields.  All fields came back in response except "reference".

Re: [EXTERNAL] - Re: Solr not returning stored field

Posted by Erick Erickson <er...@gmail.com>.
Follow the instructions here: http://lucene.apache.org/solr/community.html#mailing-lists-irc
. You must use the _exact_ same e-mail as you used to subscribe.

If the initial try doesn't work and following the suggestions at the "problems" link doesn't work for you, let us know. But note you need to show us the _entire_ return header to allow anyone to diagnose the problem.

Best,
Erick


> On Jul 1, 2019, at 8:54 AM, Ashwin Tandel <as...@gmail.com> wrote:
> 
> Pls unsubscribe me.
> 
> Thanks in Advance.
> 
> On Thu, Jun 27, 2019 at 2:30 PM Alexandre Rafalovitch
> <ar...@gmail.com> wrote:
>> 
>> Half the time I end up using a "power hammer" for all sorts of small
>> "nails".
>> 
>> Specifically I use Wiresharm network tracer to see exactly what happens on
>> wire level and what servers are involved.
>> 
>> A true overkill but it would have worked here...
>> 
>> Regards,
>>    Alex
>> 
>> On Thu, Jun 27, 2019, 3:09 PM Erick Erickson, <er...@gmail.com>
>> wrote:
>> 
>>> Thanks for bringing closure, this was really puzzling. Don’t want to
>>> mention how many times I’ve spent hours/days trying to understand something
>>> only to finally figure out something similar ;).
>>> 
>>> Best,
>>> Erick
>>> 
>>>> On Jun 27, 2019, at 11:53 AM, Steve Pruitt <bp...@opentext.com> wrote:
>>>> 
>>>> Ok.  When something makes no sense.  Go back to the very beginning.  I
>>> was using an out of date configuration file which pointed SolrJ to another
>>> running Solr that had a core similar enough to the one running on localhost
>>> that I could not see an issue... until I checked everything.
>>>> 
>>>> All is good.
>>>> 
>>>> -S
>>>> 
>>>> -----Original Message-----
>>>> From: Steve Pruitt <bp...@opentext.com>
>>>> Sent: Thursday, June 27, 2019 2:46 PM
>>>> To: solr-user@lucene.apache.org
>>>> Subject: RE: [EXTERNAL] - Re: Solr not returning stored field
>>>> 
>>>> Ok, I am totally confused.
>>>> 
>>>> It works fine using Solr Admin console on some test cases.  I set the fl
>>> box with ranking reference and I get back both fields.
>>>> 
>>>> For completeness, I clicked the url constructed for the query and it
>>> works fine too.
>>>> Example:
>>> http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456
>>>> 
>>>> Here is the confusing part.
>>>> I stepped through my code, as I looped through the returned documents I
>>> copied the user value from the response and pasted user:value into the
>>> Admin console and get no results.  Yet, in my code using SolrQuery I see a
>>> response for the same user:value with the ranking field.
>>>> 
>>>> This makes no sense to me.  The Admin console is usually the source of
>>> truth.  Why would I get no response from the console, but see a response
>>> using SolrJ?
>>>> 
>>>> 
>>>> -----Original Message-----
>>>> From: Alexandre Rafalovitch <ar...@gmail.com>
>>>> Sent: Thursday, June 27, 2019 1:44 PM
>>>> To: solr-user <so...@lucene.apache.org>
>>>> Subject: [EXTERNAL] - Re: Solr not returning stored field
>>>> 
>>>> (If no other SolrJ specific advice shows up)....
>>>> 
>>>> Can you divide the problem in a middle a see what happens and whether
>>> the issue is Solr or SolrJ side.
>>>> 
>>>> Specifically, execute the query directly against Solr and see what
>>> happens.
>>>> 
>>>> Also I would triple-check that the documents you are getting back
>>> actually have the field. Sometimes not all documents do and the query
>>> returns those wirhout first. Cross check by getting returned IDs and
>>> looking up the full record directly in Solr.
>>>> 
>>>> Regards,
>>>>   Alex
>>>> 
>>>> On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com>
>>> wrote:
>>>> 
>>>>> I cannot get Solr to return a stored field.
>>>>> 
>>>>> My schema is:
>>>>> 
>>>>> :
>>>>> <field name="user" type="plong" indexed="true" stored="true"/> <field
>>>>> name="ranking" type="pdouble" indexed="false" stored="true"/> <field
>>>>> name="reference" type="string" indexed="false" stored="true"/>
>>>>> :
>>>>> 
>>>>> I am using the SolrJ client and trying this:
>>>>> 
>>>>> The query string contains = " user: " and a list of user field values;
>>>>> The query executes ok.  I get several documents.
>>>>> 
>>>>> SolrQuery solrQuery = new SolrQuery(query);
>>>>> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc);
>>>>> solrQuery.addField("ranking"); solrQuery.addField("reference");
>>>>> 
>>>>> I also tried:
>>>>> 
>>>>> solrQuery.setFields("ranking", " reference");
>>>>> 
>>>>> But the result has only the "ranking" field.
>>>>> Before explicitly setting the fields.  All fields came back in
>>>>> response except "reference".
>>>>> 
>>> 
>>> 


Re: [EXTERNAL] - Re: Solr not returning stored field

Posted by Ashwin Tandel <as...@gmail.com>.
Pls unsubscribe me.

Thanks in Advance.

On Thu, Jun 27, 2019 at 2:30 PM Alexandre Rafalovitch
<ar...@gmail.com> wrote:
>
> Half the time I end up using a "power hammer" for all sorts of small
> "nails".
>
> Specifically I use Wiresharm network tracer to see exactly what happens on
> wire level and what servers are involved.
>
> A true overkill but it would have worked here...
>
> Regards,
>     Alex
>
> On Thu, Jun 27, 2019, 3:09 PM Erick Erickson, <er...@gmail.com>
> wrote:
>
> > Thanks for bringing closure, this was really puzzling. Don’t want to
> > mention how many times I’ve spent hours/days trying to understand something
> > only to finally figure out something similar ;).
> >
> > Best,
> > Erick
> >
> > > On Jun 27, 2019, at 11:53 AM, Steve Pruitt <bp...@opentext.com> wrote:
> > >
> > > Ok.  When something makes no sense.  Go back to the very beginning.  I
> > was using an out of date configuration file which pointed SolrJ to another
> > running Solr that had a core similar enough to the one running on localhost
> > that I could not see an issue... until I checked everything.
> > >
> > > All is good.
> > >
> > > -S
> > >
> > > -----Original Message-----
> > > From: Steve Pruitt <bp...@opentext.com>
> > > Sent: Thursday, June 27, 2019 2:46 PM
> > > To: solr-user@lucene.apache.org
> > > Subject: RE: [EXTERNAL] - Re: Solr not returning stored field
> > >
> > > Ok, I am totally confused.
> > >
> > > It works fine using Solr Admin console on some test cases.  I set the fl
> > box with ranking reference and I get back both fields.
> > >
> > > For completeness, I clicked the url constructed for the query and it
> > works fine too.
> > > Example:
> > http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456
> > >
> > > Here is the confusing part.
> > > I stepped through my code, as I looped through the returned documents I
> > copied the user value from the response and pasted user:value into the
> > Admin console and get no results.  Yet, in my code using SolrQuery I see a
> > response for the same user:value with the ranking field.
> > >
> > > This makes no sense to me.  The Admin console is usually the source of
> > truth.  Why would I get no response from the console, but see a response
> > using SolrJ?
> > >
> > >
> > > -----Original Message-----
> > > From: Alexandre Rafalovitch <ar...@gmail.com>
> > > Sent: Thursday, June 27, 2019 1:44 PM
> > > To: solr-user <so...@lucene.apache.org>
> > > Subject: [EXTERNAL] - Re: Solr not returning stored field
> > >
> > > (If no other SolrJ specific advice shows up)....
> > >
> > > Can you divide the problem in a middle a see what happens and whether
> > the issue is Solr or SolrJ side.
> > >
> > > Specifically, execute the query directly against Solr and see what
> > happens.
> > >
> > > Also I would triple-check that the documents you are getting back
> > actually have the field. Sometimes not all documents do and the query
> > returns those wirhout first. Cross check by getting returned IDs and
> > looking up the full record directly in Solr.
> > >
> > > Regards,
> > >    Alex
> > >
> > > On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com>
> > wrote:
> > >
> > >> I cannot get Solr to return a stored field.
> > >>
> > >> My schema is:
> > >>
> > >> :
> > >> <field name="user" type="plong" indexed="true" stored="true"/> <field
> > >> name="ranking" type="pdouble" indexed="false" stored="true"/> <field
> > >> name="reference" type="string" indexed="false" stored="true"/>
> > >> :
> > >>
> > >> I am using the SolrJ client and trying this:
> > >>
> > >> The query string contains = " user: " and a list of user field values;
> > >> The query executes ok.  I get several documents.
> > >>
> > >> SolrQuery solrQuery = new SolrQuery(query);
> > >> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc);
> > >> solrQuery.addField("ranking"); solrQuery.addField("reference");
> > >>
> > >> I also tried:
> > >>
> > >> solrQuery.setFields("ranking", " reference");
> > >>
> > >> But the result has only the "ranking" field.
> > >> Before explicitly setting the fields.  All fields came back in
> > >> response except "reference".
> > >>
> >
> >

Re: [EXTERNAL] - Re: Solr not returning stored field

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Half the time I end up using a "power hammer" for all sorts of small
"nails".

Specifically I use Wiresharm network tracer to see exactly what happens on
wire level and what servers are involved.

A true overkill but it would have worked here...

Regards,
    Alex

On Thu, Jun 27, 2019, 3:09 PM Erick Erickson, <er...@gmail.com>
wrote:

> Thanks for bringing closure, this was really puzzling. Don’t want to
> mention how many times I’ve spent hours/days trying to understand something
> only to finally figure out something similar ;).
>
> Best,
> Erick
>
> > On Jun 27, 2019, at 11:53 AM, Steve Pruitt <bp...@opentext.com> wrote:
> >
> > Ok.  When something makes no sense.  Go back to the very beginning.  I
> was using an out of date configuration file which pointed SolrJ to another
> running Solr that had a core similar enough to the one running on localhost
> that I could not see an issue... until I checked everything.
> >
> > All is good.
> >
> > -S
> >
> > -----Original Message-----
> > From: Steve Pruitt <bp...@opentext.com>
> > Sent: Thursday, June 27, 2019 2:46 PM
> > To: solr-user@lucene.apache.org
> > Subject: RE: [EXTERNAL] - Re: Solr not returning stored field
> >
> > Ok, I am totally confused.
> >
> > It works fine using Solr Admin console on some test cases.  I set the fl
> box with ranking reference and I get back both fields.
> >
> > For completeness, I clicked the url constructed for the query and it
> works fine too.
> > Example:
> http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456
> >
> > Here is the confusing part.
> > I stepped through my code, as I looped through the returned documents I
> copied the user value from the response and pasted user:value into the
> Admin console and get no results.  Yet, in my code using SolrQuery I see a
> response for the same user:value with the ranking field.
> >
> > This makes no sense to me.  The Admin console is usually the source of
> truth.  Why would I get no response from the console, but see a response
> using SolrJ?
> >
> >
> > -----Original Message-----
> > From: Alexandre Rafalovitch <ar...@gmail.com>
> > Sent: Thursday, June 27, 2019 1:44 PM
> > To: solr-user <so...@lucene.apache.org>
> > Subject: [EXTERNAL] - Re: Solr not returning stored field
> >
> > (If no other SolrJ specific advice shows up)....
> >
> > Can you divide the problem in a middle a see what happens and whether
> the issue is Solr or SolrJ side.
> >
> > Specifically, execute the query directly against Solr and see what
> happens.
> >
> > Also I would triple-check that the documents you are getting back
> actually have the field. Sometimes not all documents do and the query
> returns those wirhout first. Cross check by getting returned IDs and
> looking up the full record directly in Solr.
> >
> > Regards,
> >    Alex
> >
> > On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com>
> wrote:
> >
> >> I cannot get Solr to return a stored field.
> >>
> >> My schema is:
> >>
> >> :
> >> <field name="user" type="plong" indexed="true" stored="true"/> <field
> >> name="ranking" type="pdouble" indexed="false" stored="true"/> <field
> >> name="reference" type="string" indexed="false" stored="true"/>
> >> :
> >>
> >> I am using the SolrJ client and trying this:
> >>
> >> The query string contains = " user: " and a list of user field values;
> >> The query executes ok.  I get several documents.
> >>
> >> SolrQuery solrQuery = new SolrQuery(query);
> >> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc);
> >> solrQuery.addField("ranking"); solrQuery.addField("reference");
> >>
> >> I also tried:
> >>
> >> solrQuery.setFields("ranking", " reference");
> >>
> >> But the result has only the "ranking" field.
> >> Before explicitly setting the fields.  All fields came back in
> >> response except "reference".
> >>
>
>

Re: [EXTERNAL] - Re: Solr not returning stored field

Posted by Erick Erickson <er...@gmail.com>.
Thanks for bringing closure, this was really puzzling. Don’t want to mention how many times I’ve spent hours/days trying to understand something only to finally figure out something similar ;).

Best,
Erick

> On Jun 27, 2019, at 11:53 AM, Steve Pruitt <bp...@opentext.com> wrote:
> 
> Ok.  When something makes no sense.  Go back to the very beginning.  I was using an out of date configuration file which pointed SolrJ to another running Solr that had a core similar enough to the one running on localhost that I could not see an issue... until I checked everything.
> 
> All is good.
> 
> -S
> 
> -----Original Message-----
> From: Steve Pruitt <bp...@opentext.com> 
> Sent: Thursday, June 27, 2019 2:46 PM
> To: solr-user@lucene.apache.org
> Subject: RE: [EXTERNAL] - Re: Solr not returning stored field
> 
> Ok, I am totally confused.
> 
> It works fine using Solr Admin console on some test cases.  I set the fl box with ranking reference and I get back both fields.
> 
> For completeness, I clicked the url constructed for the query and it works fine too.
> Example: http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456
> 
> Here is the confusing part.
> I stepped through my code, as I looped through the returned documents I copied the user value from the response and pasted user:value into the Admin console and get no results.  Yet, in my code using SolrQuery I see a response for the same user:value with the ranking field.
> 
> This makes no sense to me.  The Admin console is usually the source of truth.  Why would I get no response from the console, but see a response using SolrJ?
> 
> 
> -----Original Message-----
> From: Alexandre Rafalovitch <ar...@gmail.com>
> Sent: Thursday, June 27, 2019 1:44 PM
> To: solr-user <so...@lucene.apache.org>
> Subject: [EXTERNAL] - Re: Solr not returning stored field
> 
> (If no other SolrJ specific advice shows up)....
> 
> Can you divide the problem in a middle a see what happens and whether the issue is Solr or SolrJ side.
> 
> Specifically, execute the query directly against Solr and see what happens.
> 
> Also I would triple-check that the documents you are getting back actually have the field. Sometimes not all documents do and the query returns those wirhout first. Cross check by getting returned IDs and looking up the full record directly in Solr.
> 
> Regards,
>    Alex
> 
> On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com> wrote:
> 
>> I cannot get Solr to return a stored field.
>> 
>> My schema is:
>> 
>> :
>> <field name="user" type="plong" indexed="true" stored="true"/> <field 
>> name="ranking" type="pdouble" indexed="false" stored="true"/> <field 
>> name="reference" type="string" indexed="false" stored="true"/>
>> :
>> 
>> I am using the SolrJ client and trying this:
>> 
>> The query string contains = " user: " and a list of user field values; 
>> The query executes ok.  I get several documents.
>> 
>> SolrQuery solrQuery = new SolrQuery(query); 
>> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc); 
>> solrQuery.addField("ranking"); solrQuery.addField("reference");
>> 
>> I also tried:
>> 
>> solrQuery.setFields("ranking", " reference");
>> 
>> But the result has only the "ranking" field.
>> Before explicitly setting the fields.  All fields came back in 
>> response except "reference".
>> 


RE: [EXTERNAL] - Re: Solr not returning stored field

Posted by Steve Pruitt <bp...@opentext.com>.
Ok.  When something makes no sense.  Go back to the very beginning.  I was using an out of date configuration file which pointed SolrJ to another running Solr that had a core similar enough to the one running on localhost that I could not see an issue... until I checked everything.

All is good.

-S

-----Original Message-----
From: Steve Pruitt <bp...@opentext.com> 
Sent: Thursday, June 27, 2019 2:46 PM
To: solr-user@lucene.apache.org
Subject: RE: [EXTERNAL] - Re: Solr not returning stored field

Ok, I am totally confused.

It works fine using Solr Admin console on some test cases.  I set the fl box with ranking reference and I get back both fields.

For completeness, I clicked the url constructed for the query and it works fine too.
Example: http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456

Here is the confusing part.
I stepped through my code, as I looped through the returned documents I copied the user value from the response and pasted user:value into the Admin console and get no results.  Yet, in my code using SolrQuery I see a response for the same user:value with the ranking field.

This makes no sense to me.  The Admin console is usually the source of truth.  Why would I get no response from the console, but see a response using SolrJ?


-----Original Message-----
From: Alexandre Rafalovitch <ar...@gmail.com>
Sent: Thursday, June 27, 2019 1:44 PM
To: solr-user <so...@lucene.apache.org>
Subject: [EXTERNAL] - Re: Solr not returning stored field

(If no other SolrJ specific advice shows up)....

Can you divide the problem in a middle a see what happens and whether the issue is Solr or SolrJ side.

Specifically, execute the query directly against Solr and see what happens.

Also I would triple-check that the documents you are getting back actually have the field. Sometimes not all documents do and the query returns those wirhout first. Cross check by getting returned IDs and looking up the full record directly in Solr.

Regards,
    Alex

On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com> wrote:

> I cannot get Solr to return a stored field.
>
> My schema is:
>
> :
> <field name="user" type="plong" indexed="true" stored="true"/> <field 
> name="ranking" type="pdouble" indexed="false" stored="true"/> <field 
> name="reference" type="string" indexed="false" stored="true"/>
> :
>
> I am using the SolrJ client and trying this:
>
> The query string contains = " user: " and a list of user field values; 
> The query executes ok.  I get several documents.
>
> SolrQuery solrQuery = new SolrQuery(query); 
> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc); 
> solrQuery.addField("ranking"); solrQuery.addField("reference");
>
> I also tried:
>
> solrQuery.setFields("ranking", " reference");
>
> But the result has only the "ranking" field.
> Before explicitly setting the fields.  All fields came back in 
> response except "reference".
>

RE: [EXTERNAL] - Re: Solr not returning stored field

Posted by Steve Pruitt <bp...@opentext.com>.
Ok, I am totally confused.

It works fine using Solr Admin console on some test cases.  I set the fl box with ranking reference and I get back both fields.

For completeness, I clicked the url constructed for the query and it works fine too.
Example: http://localhost:8983/solr/suggestion/select?fl=ranking%20reference&q=user:100000456

Here is the confusing part.
I stepped through my code, as I looped through the returned documents I copied the user value from the response and pasted user:value into the Admin console and get no results.  Yet, in my code using SolrQuery I see a response for the same user:value with the ranking field.

This makes no sense to me.  The Admin console is usually the source of truth.  Why would I get no response from the console, but see a response using SolrJ?


-----Original Message-----
From: Alexandre Rafalovitch <ar...@gmail.com> 
Sent: Thursday, June 27, 2019 1:44 PM
To: solr-user <so...@lucene.apache.org>
Subject: [EXTERNAL] - Re: Solr not returning stored field

(If no other SolrJ specific advice shows up)....

Can you divide the problem in a middle a see what happens and whether the issue is Solr or SolrJ side.

Specifically, execute the query directly against Solr and see what happens.

Also I would triple-check that the documents you are getting back actually have the field. Sometimes not all documents do and the query returns those wirhout first. Cross check by getting returned IDs and looking up the full record directly in Solr.

Regards,
    Alex

On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com> wrote:

> I cannot get Solr to return a stored field.
>
> My schema is:
>
> :
> <field name="user" type="plong" indexed="true" stored="true"/> <field 
> name="ranking" type="pdouble" indexed="false" stored="true"/> <field 
> name="reference" type="string" indexed="false" stored="true"/>
> :
>
> I am using the SolrJ client and trying this:
>
> The query string contains = " user: " and a list of user field values; 
> The query executes ok.  I get several documents.
>
> SolrQuery solrQuery = new SolrQuery(query); 
> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc); 
> solrQuery.addField("ranking"); solrQuery.addField("reference");
>
> I also tried:
>
> solrQuery.setFields("ranking", " reference");
>
> But the result has only the "ranking" field.
> Before explicitly setting the fields.  All fields came back in 
> response except "reference".
>

Re: Solr not returning stored field

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
(If no other SolrJ specific advice shows up)....

Can you divide the problem in a middle a see what happens and whether the
issue is Solr or SolrJ side.

Specifically, execute the query directly against Solr and see what happens.

Also I would triple-check that the documents you are getting back actually
have the field. Sometimes not all documents do and the query returns those
wirhout first. Cross check by getting returned IDs and looking up the full
record directly in Solr.

Regards,
    Alex

On Thu, Jun 27, 2019, 1:37 PM Steve Pruitt, <bp...@opentext.com> wrote:

> I cannot get Solr to return a stored field.
>
> My schema is:
>
> :
> <field name="user" type="plong" indexed="true" stored="true"/>
> <field name="ranking" type="pdouble" indexed="false" stored="true"/>
> <field name="reference" type="string" indexed="false" stored="true"/>
> :
>
> I am using the SolrJ client and trying this:
>
> The query string contains = " user: " and a list of user field values;
> The query executes ok.  I get several documents.
>
> SolrQuery solrQuery = new SolrQuery(query);
> solrQuery.setSort("ranking" , SolrQuery.ORDER.desc);
> solrQuery.addField("ranking");
> solrQuery.addField("reference");
>
> I also tried:
>
> solrQuery.setFields("ranking", " reference");
>
> But the result has only the "ranking" field.
> Before explicitly setting the fields.  All fields came back in response
> except "reference".
>