lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhenyuan wei <tins...@gmail.com>
Subject Re: Is that a mistake or bug?
Date Mon, 03 Sep 2018 08:23:37 GMT
I mean, use terminatedEarly as basic boolean type, then  no need to explicitly
assign it as Boolean.FALSE,  because basic boolean's default value is false.

Mikhail Khludnev <mkhl@apache.org> 于2018年9月3日周一 下午4:13写道:

> Nope. In this case, it will respond terminatedEarly=false even if noone
> request it.
>
> On Mon, Sep 3, 2018 at 9:09 AM zhenyuan wei <tinswzy@gmail.com> wrote:
>
> > Yeah,got it~. So the QueryResult.segmentTerminatedEarly maybe a boolean,
> > instead of Boolean,  is better, right?
> >
> > Mikhail Khludnev <mkhl@apache.org> 于2018年9月3日周一 下午1:36写道:
> >
> > > It's neither, it's on purpose. By default
> result.segmentTerminatedEarly
> > is
> > > null, hence it doesn't appear in result output. see
> > > ResponseBuilder.setResult(QueryResult).
> > > So, if cmd requests early termination, it sets false by default,
> enabling
> > > "false" output even it won't be the case. And later it might be flipped
> > to
> > > true.
> > >
> > >
> > > On Mon, Sep 3, 2018 at 5:57 AM zhenyuan wei <tinswzy@gmail.com> wrote:
> > >
> > > > Hi all,
> > > >     I saw the code like following:
> > > >
> > > > QueryResult result = new QueryResult();
> > > >
> > > >
> > > >
> > >
> >
> cmd.setSegmentTerminateEarly(params.getBool(CommonParams.SEGMENT_TERMINATE_EARLY,
> > > > CommonParams.SEGMENT_TERMINATE_EARLY_DEFAULT));
> > > > if (cmd.getSegmentTerminateEarly()) {
> > > >   result.setSegmentTerminatedEarly(Boolean.FALSE);
> > > > }
> > > >
> > > > It says if request's param segmentTerminateEarly=true, which means
> > search
> > > > maybe terminated early within a segment,  then set
> > > > result.setSegmentTerminatedEarly as false , this code is of a little
> > > > confusion
> > > > .
> > > >
> > >
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> > >
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message