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 mrw <mi...@gmail.com> on 2011/03/15 14:21:07 UTC

Dismax: field not returned unless in sort clause?

We have a "D" field (string, indexed, stored, not required) that is returned
* when we search with the standard request handler
* when we search with dismax request handler _and the field is specified in
the sort parameter_

but is not returned when using the dismax handler and the field is not
specified in the sort param.

IOW, if I do the following query (no sort param), I get all the expected
results, but the D field never comes back...

&q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D

...but if I add "D" to the sort param, the D field comes back on every
single record

&q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D&sort=D%20asc
&q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D&sort=D%20desc

If I omit the fl param, I see that all of our other fields appear to be
returned on every result without any need to specify them in the sort param.  

Obviously, I cannot hard-code the sort order around the D field.  :)

Any ideas?   


Thanks!


--
View this message in context: http://lucene.472066.n3.nabble.com/Dismax-field-not-returned-unless-in-sort-clause-tp2681447p2681447.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Dismax: field not returned unless in sort clause?

Posted by mrw <mi...@gmail.com>.
No, not setting those options in the query or schema.xml file.

I'll try what you said, however.


Thanks


Chris Hostetter-3 wrote:
> 
> : We have a "D" field (string, indexed, stored, not required) that is
> returned
> : * when we search with the standard request handler
> : * when we search with dismax request handler _and the field is specified
> in
> : the sort parameter_
> : 
> : but is not returned when using the dismax handler and the field is not
> : specified in the sort param.
> 
> are you using one of the "sortMissing" options on D or it's fieldType?
> 
> I'm guessing you have sortMissingLast="true" for D, so anytime you sort on 
> it the docs that do have a value appear first.  but when you don't sort on 
> it, other factors probably lead docs that don't have a value for the D 
> field to appear first -- solr doesn't include fields in docs that don't 
> have any value for that field.
> 
> if my guess is correct, adding "fq=D:[* TO *] to any of your queries will 
> cause the total number of results to shrink, but the first page of results 
> for your requests that don't sort on D will look exactly the same.
> 
> the LUkeRequestHandler will help you see how many docs in your index don't 
> have any values indexed in the "D" field.
> 
> 
> -Hoss
> 


--
View this message in context: http://lucene.472066.n3.nabble.com/Dismax-field-not-returned-unless-in-sort-clause-tp2681447p2688039.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Dismax: field not returned unless in sort clause?

Posted by Chris Hostetter <ho...@fucit.org>.
: We have a "D" field (string, indexed, stored, not required) that is returned
: * when we search with the standard request handler
: * when we search with dismax request handler _and the field is specified in
: the sort parameter_
: 
: but is not returned when using the dismax handler and the field is not
: specified in the sort param.

are you using one of the "sortMissing" options on D or it's fieldType?

I'm guessing you have sortMissingLast="true" for D, so anytime you sort on 
it the docs that do have a value appear first.  but when you don't sort on 
it, other factors probably lead docs that don't have a value for the D 
field to appear first -- solr doesn't include fields in docs that don't 
have any value for that field.

if my guess is correct, adding "fq=D:[* TO *] to any of your queries will 
cause the total number of results to shrink, but the first page of results 
for your requests that don't sort on D will look exactly the same.

the LUkeRequestHandler will help you see how many docs in your index don't 
have any values indexed in the "D" field.


-Hoss

Re: Dismax: field not returned unless in sort clause?

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Tue, 3/15/11, mrw <mi...@gmail.com> wrote:

> From: mrw <mi...@gmail.com>
> Subject: Dismax:  field not returned unless in sort clause?
> To: solr-user@lucene.apache.org
> Date: Tuesday, March 15, 2011, 3:21 PM
> We have a "D" field (string, indexed,
> stored, not required) that is returned
> * when we search with the standard request handler
> * when we search with dismax request handler _and the field
> is specified in
> the sort parameter_
> 
> but is not returned when using the dismax handler and the
> field is not
> specified in the sort param.
> 
> IOW, if I do the following query (no sort param), I get all
> the expected
> results, but the D field never comes back...
> 
> &q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D
> 
> ...but if I add "D" to the sort param, the D field comes
> back on every
> single record
> 
> &q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D&sort=D%20asc
> &q=&q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A,B,C&start=0&rows=300&fl=D&sort=D%20desc
> 
> If I omit the fl param, I see that all of our other fields
> appear to be
> returned on every result without any need to specify them
> in the sort param.  
> 
> Obviously, I cannot hard-code the sort order around the D
> field.  :)

Can you use one space in qf parameter while separating field names?

q.alt=*:*&defType=dismax&tie=0.1&mm=1&qf=A B C&start=0&rows=300&fl=D