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 Asaf work <as...@dapper.net> on 2009/11/19 17:32:49 UTC

Problem with SolrJ driver for Solr 1.4

Hi,

I'm using the SolrJ 1.4 client driver in a sharded Solr configuration and am
experiencing 2 problems:

1) *The method SolrQuery.setIncludeScore(true)*:
The current implementation of setIncludeScore(boolean) *adds *the value
"score" to the FL parameter.
This causes a problem when using the setFields followed by include score.
If I do this:

setFields("*");
setIncludeScore(true);

I would expect the outcome to be "fl=*,score"
Instead the outcome is: "fl=* &fl=score" which fails to use the score field
as FL is not a multi-valued field.

The current implementation in the SolrJ SolrQuery object is:
add("fl", "score")
instead it should be:
set("fl", get("fl") + ",score")

obviously not as simplistic as that, but you catch my drift...

2) *Propagating "*,score" value to shards*:
When doing an HTTP request to a Solr Server using the shards the behavior of
the response varies.

The following requests cause the entire document (all fields) to return in
the response:

http://localhost:8180/solr/cpaCore/select/?q=*:*
> http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score
>
> http://localhost:8180/solr/cpaCore/select/?q=*:*&shards=shardLocation/solr/cpaCore
>

The following request causes only the fields "id" and "score" to return in
the response:

http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score&shards=localhost:8180/solr/cpaCore
>

I don't know if this is by design but it does provide for some inconsistent
behavior, as shard requests behave differently than regular requests.
Currently we worked around these 2 issues, I'm just submitting them for your
opinions and views on whether JIRA issues should be opened.


With Thanks
  Asaf Ary

Re: Problem with SolrJ driver for Solr 1.4

Posted by Asaf work <as...@dapper.net>.
Opened JIRA issues:

https://issues.apache.org/jira/browse/SOLR-1584
https://issues.apache.org/jira/browse/SOLR-1587


--
Asaf Ary

On Sat, Nov 21, 2009 at 6:58 AM, Lance Norskog <go...@gmail.com> wrote:

> Yes, these are both bugs. SolrJ should do field lists right, and
> distributed search should work exactly the same as normal search.
>
> Please file these in the JIRA.
>
> On Thu, Nov 19, 2009 at 8:32 AM, Asaf work <as...@dapper.net> wrote:
> > Hi,
> >
> > I'm using the SolrJ 1.4 client driver in a sharded Solr configuration and
> am
> > experiencing 2 problems:
> >
> > 1) *The method SolrQuery.setIncludeScore(true)*:
> > The current implementation of setIncludeScore(boolean) *adds *the value
> > "score" to the FL parameter.
> > This causes a problem when using the setFields followed by include score.
> > If I do this:
> >
> > setFields("*");
> > setIncludeScore(true);
> >
> > I would expect the outcome to be "fl=*,score"
> > Instead the outcome is: "fl=* &fl=score" which fails to use the score
> field
> > as FL is not a multi-valued field.
> >
> > The current implementation in the SolrJ SolrQuery object is:
> > add("fl", "score")
> > instead it should be:
> > set("fl", get("fl") + ",score")
> >
> > obviously not as simplistic as that, but you catch my drift...
> >
> > 2) *Propagating "*,score" value to shards*:
> > When doing an HTTP request to a Solr Server using the shards the behavior
> of
> > the response varies.
> >
> > The following requests cause the entire document (all fields) to return
> in
> > the response:
> >
> > http://localhost:8180/solr/cpaCore/select/?q=*:*
> >> http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score
> >>
> >>
> http://localhost:8180/solr/cpaCore/select/?q=*:*&shards=shardLocation/solr/cpaCore
> >>
> >
> > The following request causes only the fields "id" and "score" to return
> in
> > the response:
> >
> >
> http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score&shards=localhost:8180/solr/cpaCore
> >>
> >
> > I don't know if this is by design but it does provide for some
> inconsistent
> > behavior, as shard requests behave differently than regular requests.
> > Currently we worked around these 2 issues, I'm just submitting them for
> your
> > opinions and views on whether JIRA issues should be opened.
> >
> >
> > With Thanks
> >  Asaf Ary
> >
>
>
>
> --
> Lance Norskog
> goksron@gmail.com
>

Re: Problem with SolrJ driver for Solr 1.4

Posted by Lance Norskog <go...@gmail.com>.
Yes, these are both bugs. SolrJ should do field lists right, and
distributed search should work exactly the same as normal search.

Please file these in the JIRA.

On Thu, Nov 19, 2009 at 8:32 AM, Asaf work <as...@dapper.net> wrote:
> Hi,
>
> I'm using the SolrJ 1.4 client driver in a sharded Solr configuration and am
> experiencing 2 problems:
>
> 1) *The method SolrQuery.setIncludeScore(true)*:
> The current implementation of setIncludeScore(boolean) *adds *the value
> "score" to the FL parameter.
> This causes a problem when using the setFields followed by include score.
> If I do this:
>
> setFields("*");
> setIncludeScore(true);
>
> I would expect the outcome to be "fl=*,score"
> Instead the outcome is: "fl=* &fl=score" which fails to use the score field
> as FL is not a multi-valued field.
>
> The current implementation in the SolrJ SolrQuery object is:
> add("fl", "score")
> instead it should be:
> set("fl", get("fl") + ",score")
>
> obviously not as simplistic as that, but you catch my drift...
>
> 2) *Propagating "*,score" value to shards*:
> When doing an HTTP request to a Solr Server using the shards the behavior of
> the response varies.
>
> The following requests cause the entire document (all fields) to return in
> the response:
>
> http://localhost:8180/solr/cpaCore/select/?q=*:*
>> http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score
>>
>> http://localhost:8180/solr/cpaCore/select/?q=*:*&shards=shardLocation/solr/cpaCore
>>
>
> The following request causes only the fields "id" and "score" to return in
> the response:
>
> http://localhost:8180/solr/cpaCore/select/?q=*:*&fl=score&shards=localhost:8180/solr/cpaCore
>>
>
> I don't know if this is by design but it does provide for some inconsistent
> behavior, as shard requests behave differently than regular requests.
> Currently we worked around these 2 issues, I'm just submitting them for your
> opinions and views on whether JIRA issues should be opened.
>
>
> With Thanks
>  Asaf Ary
>



-- 
Lance Norskog
goksron@gmail.com