From solr-user-return-143439-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Mon Sep 3 10:52:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 53E8D180647 for ; Mon, 3 Sep 2018 10:52:59 +0200 (CEST) Received: (qmail 2539 invoked by uid 500); 3 Sep 2018 08:52:57 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 2520 invoked by uid 99); 3 Sep 2018 08:52:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2018 08:52:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EC5DC180943 for ; Mon, 3 Sep 2018 08:52:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.111 X-Spam-Level: X-Spam-Status: No, score=-0.111 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=centrum.cz Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id wi0gW4tCDXdD for ; Mon, 3 Sep 2018 08:52:54 +0000 (UTC) Received: from gmmr3.centrum.cz (gmmr3.centrum.cz [46.255.225.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D1D1B5F382 for ; Mon, 3 Sep 2018 08:52:53 +0000 (UTC) Received: from mail1013.cent (unknown [10.255.254.39]) by gmmr3.centrum.cz (Postfix) with ESMTP id 9E5131800A0FA for ; Mon, 3 Sep 2018 10:52:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=centrum.cz; s=mail; t=1535964764; bh=juhmBoN2UaD1jeR9a6iMCgzLkv7hdbF8mPoKY6SYzxM=; h=To:Subject:Date:From:References:In-Reply-To:From; b=bFrMBMZ+8X1nj6nk4YtbrUaxZiLWJpV/cl8P2l/u23D+4nSok9yWrMXbpSypj5MPa UPA0OgxXGRobf3VoTVPvXBdJtT1+pJSPc90Ud+wzEZYCYR9urqkOrvrT9w2/3AVgT1 UCFuOQ/VElerHri1N2RZevd/T1oepdbZjXsvNS3g= Received: by mail1013.cent (Postfix, from userid 33) id 96F9B600494AF; Mon, 3 Sep 2018 10:52:44 +0200 (CEST) To: Subject: =?utf-8?q?Re=3A_Is_that_a_mistake_or_bug=3F?= Received: from 82.113.61.50 by mail1013.centrum.cz (centrum.cz multimail) with HTTP Date: Mon, 03 Sep 2018 10:52:44 +0200 From: References: , , , fffc000001080001bd2004434783 In-Reply-To: fffc000001080001bd2004434783 X-Mailer: Centrum Email 5.3 X-Priority: 3 X-Original-From: p.bodnar@centrum.cz MIME-Version: 1.0 Message-Id: <20180903105244.F4BDD8AD@centrum.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, really nope :) Because as MK writes below, result.segmentTerminatedEarly is used as a 3-state variable. The only line that could be improved, is probably replacing "Boolean.FALSE" by simply "false", but that is really a minor thing... Regards PB ______________________________________________________________ > Od: "zhenyuan wei" > Komu: solr-user@lucene.apache.org > Datum: 03.09.2018 10:24 > Předmět: Re: Is that a mistake or bug? > >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 于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 wrote: >> >> > Yeah,got it~. So the QueryResult.segmentTerminatedEarly maybe a boolean, >> > instead of Boolean, is better, right? >> > >> > Mikhail Khludnev 于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 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 >> > >