Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BA92F200D4C for ; Thu, 30 Nov 2017 16:57:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B8FDF160BF4; Thu, 30 Nov 2017 15:57:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0B04C160BEA for ; Thu, 30 Nov 2017 16:57:11 +0100 (CET) Received: (qmail 53462 invoked by uid 500); 30 Nov 2017 15:57:10 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 53450 invoked by uid 99); 30 Nov 2017 15:57:10 -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; Thu, 30 Nov 2017 15:57:10 +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 1187C180797 for ; Thu, 30 Nov 2017 15:57:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 Lgycqtqu8YBB for ; Thu, 30 Nov 2017 15:57:09 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id BDF685F39D for ; Thu, 30 Nov 2017 15:57:08 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id y82so2110242wmg.1 for ; Thu, 30 Nov 2017 07:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=8U/zhRkr6m5Ky6pPOWOnjOxCs8nPBTVY+bj81A15Haw=; b=WsCBkVrNNMfm23RVbhh5LAz9OjvQHrrPeTYnAgm0azRLkoZ7NM+zbFC3j8iZWLojpq +e49yhGxTeiENLJfooDT52m7feLdt69HztlD/qQp1OdFB1njQZXfulb/N2MciYwuvjL/ bk/wsl37U5unATfVFeidM3NQbGmuAGg322nOJo+38tL3qxkraK9ZcRLWIOSELBPlsCVj 8S8Ux0W0+Oj1osaivbaPLgqvJp/pzVjgkKSgxljCskkXZ4pNRLOSiU3o+vAfH/sfelYy IH4UPg0s5+tRFQ62pMUq8dIbj5omYpZn6MgrXavGXa/9fIpmfX4nSNhvYjb36DNs8kSt TrbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=8U/zhRkr6m5Ky6pPOWOnjOxCs8nPBTVY+bj81A15Haw=; b=bZT1/25EDx6xhcXNKcUtQGSKC23iXs1eO4cqwIgbpNQCl29ndSB32+VjUSVjkCEf1q 3kWY3KHAtSelbte/Ldec0rotkzaeO7j7MljENdu8zAr/3ZqRmgCZBs4Zz+J/q3fRNzrV 1uRGvLfQJZCyTyMWZCA8Bk5lXMAcDnFxL55OHA+i6ywHI7RsmdVQBj9ZEaORx58tm6OE 2o+MewHcCEKMIa8vhVuGP5iNnp5wOC7WEplc/O/yH7rkpKYgESmSzU4X/ff7ZD2wwP3t NVirj7hKqd2/mUhL8ZelF7JRtGJ9whkPIZBzt+kXCXXpQhaVK2jQP+bnfXFMdK0EZJoo e1pA== X-Gm-Message-State: AJaThX7jrqaaBhcZ88k6SJE259bT/3dkk5AuPL5G0lKGDvj4potGUh1l P8O0Tl4Kcs5AoI8wU4G9AIW2Sw1RJnHhtMc5QyM= X-Google-Smtp-Source: AGs4zMbu082DZaSNhEq/+nahfr5vQAUFyMiFJpx4ciN5z8Jpc/T8W31s8Q6pohm2gnFA0txuvTPsRidGSm3gXhOWSmQ= X-Received: by 10.28.68.194 with SMTP id r185mr889699wma.73.1512057427444; Thu, 30 Nov 2017 07:57:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Adrien Grand Date: Thu, 30 Nov 2017 15:56:56 +0000 Message-ID: Subject: Re: COST vs SCORE vs WEIGHT To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary="001a114a4488d7c97b055f354d3b" archived-at: Thu, 30 Nov 2017 15:57:12 -0000 --001a114a4488d7c97b055f354d3b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Vadim, A Weight is the specialization of a query for a given index reader. It has access to index statistics that will help compute scores for instance. A Scorer is the specialization of a weight for a given segment. It can iterate over matches and compute scores. The cost of a scorer is the expected number of matching documents for this scorer. It is useful in order to run operations in the optimal order Your observation of the behaviour of your BooleanQuery with SHOULD clauses looks wrong: the score of the boolean query is the sum of the scores of the matching sub queries. Le jeu. 30 nov. 2017 =C3=A0 16:39, Vadim Gindin a = =C3=A9crit : > Hi > > 1) What is the principal difference between COST vs SCORE vs WEIGHT > > 2) Assume we have BooleanQuery with 5 TermQuery subqueries that are > included via SHOULD condition. Assume we have 5 fields and one subquery i= s > need to search in one field. Some product of MultiFieldQueryParser. In th= is > case the score of BooleanQuery is the sum of scores of each subquery. I > expected that not all subqueries will be included but only those who > founded something, but in fact there is a sum of all subqueries. Why? How > to implement need logic: sum of those subqueries that found something? Ho= w > to check that? > > Regards, > Vadim Gindin > --001a114a4488d7c97b055f354d3b--