From java-user-return-64619-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Mon Oct 21 16:54:54 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2E9CA180626 for ; Mon, 21 Oct 2019 18:54:54 +0200 (CEST) Received: (qmail 68748 invoked by uid 500); 21 Oct 2019 16:54:47 -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 68442 invoked by uid 99); 21 Oct 2019 16:54:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2019 16:54:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 335F31A4326 for ; Mon, 21 Oct 2019 16:54:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.701 X-Spam-Level: X-Spam-Status: No, score=-1.701 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=thetaphi.de Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id XnszCWo-O9Vb for ; Mon, 21 Oct 2019 16:54:44 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=78.47.65.36; helo=mail.sd-datasolutions.de; envelope-from=uwe@thetaphi.de; receiver= Received: from mail.sd-datasolutions.de (serv2.sd-datasolutions.de [78.47.65.36]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 21F8DBCB8A for ; Mon, 21 Oct 2019 16:54:43 +0000 (UTC) Received: from VEGA (p200300C10745F3013DA4BCF7DDD0D4E9.dip0.t-ipconnect.de [IPv6:2003:c1:745:f301:3da4:bcf7:ddd0:d4e9]) by mail.sd-datasolutions.de (Postfix) with ESMTPSA id A59B848035C for ; Mon, 21 Oct 2019 16:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thetaphi.de; s=sddsmail201905; t=1571676875; bh=ldKxSjr2llW5Rszhle4N/AWKNpNVsp1xC9MYSYtqR8o=; h=From:To:Subject:Date:Message-ID:From; b=32hHMPv3I/E73vJUb0xPpMhFSpEcZUctZ1CvfZTPJ0+aYB66qlVPwaDD/hPEePr46 IMMlsEjRgNXxpFYh27Rh3btrYcNBlNOvivMF/kq+mvFs+9BzWinqQmPnAnrnYAmKzf eSfrry+oBjyMZviFoGP1ZDZ4goyxflazSw99Gj9CHBhF02tHPkJ0OMnzvsHGZdxWiY i2MGYm8p4Yjkc4cy5DKa/WLAKHHEQYnI7FALwT415x9Jy6GsHlAGqMGwQJI6aR6TfX xHsLE15OGetCdA3YUeTIpE/Jh3bsOKstTBDoltJiid7VK6mqUcfPeBZI8iIzCAbI2l oXekMwa6k42sg== X-NSA-Greeting: Dear NSA, have fun with reading and analyzing this e-mail! From: "Uwe Schindler" To: References: <010b01d585d9$71b08950$55119bf0$@thetaphi.de> <58928f91-f28e-ca56-4ca4-f5ad9857d7d2@oracle.com> <014301d585e2$4dccd3f0$e9667bd0$@thetaphi.de> <8123d2a8-94b9-ade5-2c98-37685394b1fc@oracle.com> <24642E3D-3E0F-499A-9548-28402F741114@thetaphi.de> <87d89c1d-59b6-7ddc-b372-dedb7f1a8078@oracle.com> <048f01d5882d$70297a50$507c6ef0$@thetaphi.de> <5160afcd-8d25-2c22-4467-3e5c19b38297@oracle.com> In-Reply-To: <5160afcd-8d25-2c22-4467-3e5c19b38297@oracle.com> Subject: RE: Index-time boosting: Deprecated setBoost method Date: Mon, 21 Oct 2019 18:54:33 +0200 Message-ID: <049401d58830$378be360$a6a3aa20$@thetaphi.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: de Thread-Index: AQMCnCQAp+ovC6PCqJVfpH+41Kyc+QFVQRYWArKO92EB68q9nwJEFTyfAWxtlfYB9QH2SwHIUSNdAv0yjmwCBe08zwLb+zi6AYn/ISUC7hYf8QHkfRuKpC4+FnA= Hi, As I said, before that is a misuse of index-time boosting. In addition = in previous versions it did not even work correctly, because of query = normalization it was normalized away anyways. And on top, to change it = your have to reindex. What you intend to do is a typical use case for query time boosting with = BoostQuery. That is explained in almost every book about search, like = those about Solr or Elasticsearch. Most query parsers also allow to also add boost factors for fields, e.g. = SimpleQueryParser (for humans that need simple syntax without fields). = There you give a list of fields and boost factors. Uwe ----- Uwe Schindler Achterdiek 19, D-28357 Bremen https://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: baris.kazar@oracle.com > Sent: Monday, October 21, 2019 6:45 PM > To: java-user@lucene.apache.org > Cc: baris.kazar > Subject: Re: Index-time boosting: Deprecated setBoost method >=20 > Hi,- >=20 > Thanks and i appreciate the disccussion. >=20 > Let me please ask this way, i think i give too much info at one time: >=20 > Currently i have this: >=20 > =E2=80=A8=E2=80=A8Field f1=3D new TextField("field1", "string1", = Field.Store.YES);=E2=80=A8 >=20 > doc.add(f1); =E2=80=A8f1.setBoost(2.0f);=E2=80=A8=E2=80=A8 >=20 > Field f2 =3D new TextField("field2", "string2", = Field.Store.YES);=E2=80=A8 >=20 > doc.add(f2);=E2=80=A8 >=20 > f2.setBoost(1.0f);=E2=80=A8=E2=80=A8 >=20 >=20 > But this fails with Lucene 7.7.2. >=20 >=20 > Probably it is more efficient and more flexible to fix this by using > BoostQuery. >=20 > However, what could be the fix with index time boosting? the code in = my > previous post was trying to do that. >=20 > Best regards >=20 >=20 > On 10/21/19 12:34 PM, Uwe Schindler wrote: > > Hi, > > > > sorry I don't fully understand what you intend to do? If the boost = values > per field are static and used with exactly same value for every = document, it's > not needed a index time. You can just boost the field on the query = side (e.g. > using BoostQuery). Boosting every document with the same static values = is > an anti-pattern, that's something better suited for the query side - = as you are > more flexible. > > > > If you need a different boost value per document, you can save that = boost > value in the index per document using a docvalues field (this consumes = extra > space, of course). Then you need the ExpressionQuery on the query = side. But > just because it looks like Javascript, it's not slow. The syntax is = compiled to > bytecode and directly included into the query execution as a dynamic = java > class, so it's very fast. > > > > In short: > > - If you need to have a different boost factor per field name that's = constant > for all documents, apply it at query time with BoostQuery. > > - If you have to boost specific documents (e.g., top selling = products), index > a numeric docvalues field per document. On the query side you can use > different query types to modify the score of each result based on the > docvalues field. That can be done with Expression modules (using = compiled > Javascript) or by another query in Lucene that operates on ValueSource = (e.g., > FunctionQuery). The first one is easier to use for complex formulas.4 > > > > Uwe > > > > ----- > > Uwe Schindler > > Achterdiek 19, D-28357 Bremen > > https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > 3A__www.thetaphi.de&d=3DDwIFaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIr > MUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > BKNeyLlULCbaezrgocEvPhQkl4&m=3D70RoM6loHhMGsp95phVzGQf8w5JxW7gX > T5XnleMKrOs&s=3Dtd7cUfd22mXljSuvkUPXDunkIs_eO4GxdvHHxD2CTk0&e=3D > > eMail: uwe@thetaphi.de > > > >> -----Original Message----- > >> From: baris.kazar@oracle.com > >> Sent: Monday, October 21, 2019 5:17 PM > >> To: java-user@lucene.apache.org > >> Cc: baris.kazar > >> Subject: Re: Index-time boosting: Deprecated setBoost method > >> > >> Hi,- > >> > >> Sorry about the missing parts in previous post. please accept my > >> apologies for that. > >> > >> i needed to add a few more questions/corrections/additions to the > >> previous post: > >> > >> Main Question was: if boost is a single constant value, do we need = the > >> Javascript part below? > >> > >> > >> > >> =3D=3D=3D Indexing code snippet for Lucene version 6.6.0 and = before=3D=3D=3D > >> > >> Document doc =3D new Document(); > >> > >> > >> =E2=80=A8=E2=80=A8Field f1=3D new TextField("field1", "string1", = Field.Store.YES);=E2=80=A8 > >> > >> doc.add(f1); =E2=80=A8f1.setBoost(2.0f);=E2=80=A8=E2=80=A8 > >> > >> Field f2 =3D new TextField("field2", "string2", = Field.Store.YES);=E2=80=A8 > >> > >> doc.add(f2);=E2=80=A8 > >> > >> f2.setBoost(1.0f);=E2=80=A8=E2=80=A8 > >> > >> =3D=3D=3D end of indexing code snippet for Lucene version 6.6.0 and = before =3D=3D=3D > >> > >> > >> This turns into this where _boost1 field is associated with field1 = and > >> > >> _boost2 field is associated with field2 field: > >> > >> > >> In Indexing code: > >> > >> =3D=3D=3D begining of indexing code snippet =3D=3D=3D > >> Field f1=3D new TextField("field1", "string1", = Field.Store.YES);=E2=80=A8 > >> > >> Field _boost1 =3D new = NumericDocValuesField(=E2=80=9Cfield1=E2=80=9D, 2L); > >> doc.add(_boost1); > >> > >> // If this boost value needs to be stored, a separate storedField > >> instance needs to be added as well > >> =E2=80=A6 ( i will post this soon) > >> > >> Field _boost2 =3D new = NumericDocValuesField(=E2=80=9Cfield2=E2=80=9D, 1L); > >> doc.add(_boost2); > >> > >> // If this boost value needs to be stored, a separate storedField > >> instance needs to be added as well > >> =E2=80=A6 ( i will post this soon) > >> > >> =3D=3D=3D end of indexing code snippet =3D=3D=3D > >> > >> > >> Now, in the searching code (i.e., at query time) should i need the > >> FunctionScoreQuery because in this case > >> > >> the boost is just a constant value but not a function? However, = constant > >> value can be argued to be a function with the same value all the = time, too. > >> > >> > >> =3D=3D begining of query time code snippet =3D=3D=3D > >> Expression expr =3D JavascriptCompiler.compile(=E2=80=9C_boost1 + = _boost2"); > >> > >> =E2=80=A8=E2=80=A8// SimpleBindings just maps variables to = SortField instances=E2=80=A8 > >> > >> SimpleBindings bindings =3D new SimpleBindings();=E2=80=A8 > >> > >> bindings.add(new SortField("_boost1", = SortField.Type.LONG));=E2=80=A8 =E2=80=A8// > These > >> have to LONG type i think since NumericDocValuesField accepts = "long" > >> type only, am i right? Can this be DOUBLE type? > >> > >> bindings.add(new SortField("_boost2", = SortField.Type.LONG));=E2=80=A8 =E2=80=A8// > same > >> question here > >> > >> // create a query that matches based on body:contents but=E2=80=A8 > >> > >> // scores using expr=E2=80=A8 > >> > >> Query query =3D new FunctionScoreQuery(=E2=80=A8 > >> > >> new TermQuery(new Term("field1", = "term_to_look_for")),=E2=80=A8 > >> > >> expr.getDoubleValuesSource(bindings)); > >> > >> =E2=80=A8searcher.search(query, 10); > >> > >> =3D=3D=3D end of code snippet =3D=3D=3D > >> > >> > >> Best regards > >> > >> > >> On 10/21/19 11:05 AM, baris.kazar@oracle.com wrote: > >>> Hi,- > >>> > >>> i would like to ask the following to make it clearer (for me at = least): > >>> > >>> Document doc =3D new Document(); > >>> > >>> =E2=80=A8=E2=80=A8Field f1=3D new TextField("field1", "string1", = Field.Store.YES);=E2=80=A8 > >>> > >>> doc.add(f1); =E2=80=A8f1.setBoost(2.0f);=E2=80=A8=E2=80=A8 > >>> > >>> Field f2 =3D new TextField("field2", "string2", = Field.Store.YES);=E2=80=A8 > >>> > >>> doc.add(f2);=E2=80=A8 > >>> > >>> f2.setBoost(1.0f);=E2=80=A8=E2=80=A8 > >>> > >>> > >>> This turns into this where _boost1 field is associated with field1 = and > >>> > >>> _boost2 field is associated with field2 field: > >>> > >>> > >>> In Indexing code: > >>> > >>> Field f1=3D new TextField("field1", "string1", = Field.Store.YES);=E2=80=A8 > >>> > >>> Field _boost1 =3D new = NumericDocValuesField(=E2=80=9Cfield1=E2=80=9D, 2L); > >>> doc.add(_boost1); > >>> > >>> // If this boost value needs to be stored, a separate storedField > >>> instance needs to be added as well > >>> =E2=80=A6 ( i will post this soon) > >>> > >>> Field _boost2 =3D new = NumericDocValuesField(=E2=80=9Cfield2=E2=80=9D, 1L); > >>> doc.add(_boost2); > >>> > >>> // If this boost value needs to be stored, a separate storedField > >>> instance needs to be added as well > >>> =E2=80=A6 ( i will post this soon) > >>> > >>> > >>> Now, in the searching code (i.e., at query time) should i need the > >>> FunctionScoreQuery because in this case > >>> > >>> the boost is just a constant value but not a function? However, > >>> constant value can be argued to be a function with the same value = all > >>> the time, too. > >>> > >>> > >>> Expression expr =3D JavascriptCompiler.compile(=E2=80=9C_boost"); > >>> > >>> =E2=80=A8=E2=80=A8// SimpleBindings just maps variables to = SortField instances=E2=80=A8 > >>> > >>> SimpleBindings bindings =3D new SimpleBindings();=E2=80=A8 > >>> > >>> bindings.add(new SortField("_boost1", = SortField.Type.SCORE));=E2=80=A8 =E2=80=A8 > >>> > >>> // create a query that matches based on body:contents but=E2=80=A8 > >>> > >>> // scores using expr=E2=80=A8 > >>> > >>> Query query =3D new FunctionScoreQuery(=E2=80=A8 > >>> > >>> new TermQuery(new Term("field1", = "term_to_look_for")),=E2=80=A8 > >>> > >>> expr.getDoubleValuesSource(bindings)); > >>> > >>> =E2=80=A8searcher.search(query, 10); > >>> > >>> > >>> So, if boost is a single constant value, do we need the Javascript > >>> part above? > >>> > >>> Best regards > >>> > >>> > >>> On 10/18/19 4:07 PM, baris.kazar@oracle.com wrote: > >>>> Uwe,- > >>>> > >>>> can this > >>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> 3A__lucene.apache.org_core_7-5F7- > >> > 5F2_expressions_org_apache_lucene_expressions_Expression.html&d=3DDwID > >> > aQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DnlG5z5NcNdI > >> bQAiX- > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3DMR2S9Z9HEge6s665mtGOFRHKGmuiVYkjp > >> 4tXOciYl7A&s=3DtMCjb5H5KivfJsp-BfABonpjelgp6hn9cBg2GScCmic&e=3D > >>>> doc example that You also gave be extended with > NumericDocValuesField > >>>> part that needs to be done at indexing time boosting, too? > >>>> > >>>> i see now why You meant that this is mixed type of boosting = (i.e., > >>>> both indexing time and search time). > >>>> > >>>> I need then include this query mentioned in this example on these > >>>> _score field (i would call it _boost field in my case) into my > >>>> overall BooleanQuery. > >>>> > >>>> i will now try to combine these together and post here for future = help. > >>>> > >>>> Best regards > >>>> > >>>> > >>>> On 10/18/19 3:18 PM, Uwe Schindler wrote: > >>>>> Hi, > >>>>> > >>>>> Read my original email! The index time values are written using > >>>>> NumericDocValuesField. The expressions docs also refer to that = when > >>>>> the bindings are documented. > >>>>> > >>>>> It's separate from the indexed data (TextField). Think of it = like an > >>>>> additional numeric field in your database table with a factor in > >>>>> each row. > >>>>> > >>>>> Uwe > >>>>> > >>>>> Am October 18, 2019 7:14:03 PM UTC schrieb = baris.kazar@oracle.com: > >>>>>> Uwe,- > >>>>>> > >>>>>> Two questions there: > >>>>>> > >>>>>> i guess this is applicable to TextField, too. > >>>>>> > >>>>>> And i was expecting a index writer object in the example for = index > >>>>>> time > >>>>>> > >>>>>> boosting. > >>>>>> > >>>>>> Best regards > >>>>>> > >>>>>> > >>>>>> On 10/18/19 2:57 PM, Uwe Schindler wrote: > >>>>>>> Sorry I was imprecise. It's a mix of both. The factors are = stored per > >>>>>> document in index (this is why I called it index time). During = query > >>>>>> time the expression use the index time values to fold them into = the > >>>>>> query boost at query time. > >>>>>>> What's your problem with that approach? > >>>>>>> > >>>>>>> Uwe > >>>>>>> > >>>>>>> Am October 18, 2019 6:50:40 PM UTC schrieb > baris.kazar@oracle.com: > >>>>>>>> Uwe,- > >>>>>>>> > >>>>>>>> Thanks, if possible i am looking for a pure Java = methodology > >>>>>>>> to do > >>>>>> the > >>>>>>>> index time boosting. > >>>>>>>> > >>>>>>>> This example looks like a search time boosting example: > >>>>>>>> > >>>>>>>> > >>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> 3A__lucene.apache.org_core_7-5F7- > >> > 5F2_expressions_org_apache_lucene_expressions_Expression.html&d=3DDwIF > >> > aQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DnlG5z5NcNdI > >> bQAiX- > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6m6i5zZXPZNP6DyVv_xG4vXnVTPEdfKLeLS > >> vGjEXbyw&s=3DB5_kGwRIbAoGqL0-SVR9r3t78E5XUuzLT37TeyV-bv8&e=3D > >>>>>>>> > >>>>>>>> Best regards > >>>>>>>> > >>>>>>>> On 10/18/19 2:31 PM, Uwe Schindler wrote: > >>>>>>>>> Hi, > >>>>>>>>> > >>>>>>>>>> Is there a working example for this? Is this mentioned in = the > >>>>>> Lucene > >>>>>>>>>> Javadocs or any other docs so that i can look it? > >>>>>>>>> To index the docvalues, see NumericDocValuesField (it can be > >> added > >>>>>> to > >>>>>>>> documents like indexed or stored fields). You may have used = them > >> for > >>>>>>>> sorting already. > >>>>>>>>>> this methodology seems sort of like discouraging using = index > time > >>>>>>>> boosting. > >>>>>>>>> Not really. Many use this all the time. It's one of the = killer > >>>>>>>> features of both Solr and Elasticsearch. The problem was how = the > >>>>>>>> Document.setBoost()worked (it did not work correctly, see = below). > >>>>>>>>>> Previous setBoost method call was fine and easy to use. > >>>>>>>>>> Did it have some performance issues and then is that why it = was > >>>>>>>> deprecated? > >>>>>>>>> No the reason for deprecating this was for several reasons: > >>>>>> setBoost > >>>>>>>> was not doing what the user had expected. Internally the = boost > value > >>>>>>>> was just multiplied into the document norm factor (which is > >>>>>> internally > >>>>>>>> also a docvalues field). The norm factors are only very = inprecise > >>>>>>>> floats stored in a byte, so precision is not well. If you put = some > >>>>>>>> values into it and the length norm was already consuming all = bits, > >>>>>> the > >>>>>>>> boosting was very coarse. It was also only multiplied into = and most > >>>>>>>> users want to do some stuff like record click counts in the = index > >>>>>> and > >>>>>>>> then boost for example with the logarithm or some other = function. > If > >>>>>>>> the boost is just multiplied into the length norm you have no > >>>>>>>> flexibility at all. > >>>>>>>>> In addition you can have several docvalues fields and use = their > >>>>>>>> values in a function (e.g. one field with click count and = another > >>>>>> one > >>>>>>>> with product price). After that you can combine click count = and > >>>>>> price > >>>>>>>> (which can be modified indipenently during index updates) and > >> change > >>>>>>>> boost to boost lower price and higher click count up. > >>>>>>>>> This is what you can do with the expressions module. You = just > give > >>>>>> it > >>>>>>>> a function. > >>>>>>>>> Here is an example, the second example is using a > >>>>>> FunctionScoreQuery > >>>>>>>> that modifies the score based on the function and the given > >>>>>> docvalues: > >>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> 3A__lucene.apache.org_core_7-5F7- > >> > 5F2_expressions_org_apache_lucene_expressions_Expression.html&d=3DDwIF > >> > aQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DnlG5z5NcNdI > >> bQAiX- > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6m6i5zZXPZNP6DyVv_xG4vXnVTPEdfKLeLS > >> vGjEXbyw&s=3DB5_kGwRIbAoGqL0-SVR9r3t78E5XUuzLT37TeyV-bv8&e=3D > >>>>>>>>>> FunctionScoreQuery usage with MultiFieldQueryParser would > also > >> be > >>>>>>>> nice > >>>>>>>>>> where > >>>>>>>>>> > >>>>>>>>>> MultiFieldQuery already has boosts field to do this in its > >>>>>>>> constructor. > >>>>>>>>> The boots in the query parser are applied for fields during = query > >>>>>>>> time (to have a different weight per field). Index time = boosting is > >>>>>> per > >>>>>>>> document. So you can combine both. > >>>>>>>>>> Maybe it is not needed with MultiFieldQueryParser. > >>>>>>>>> You use MultiFieldQueryParser to adjust weights of the = fields (e.g. > >>>>>>>> title versus body). The parsed query is then wrapped with an > >>>>>> expression > >>>>>>>> that modifies the score per document according to the = docvalues. > >>>>>>>>> Uwe > >>>>>>>>> > >>>>>>>>>> On 10/18/19 1:28 PM, Uwe Schindler wrote: > >>>>>>>>>> > >>>>>>>>>>> Hi, > >>>>>>>>>>> > >>>>>>>>>>> that's not true. You can do index time boosting, but you = need > to > >>>>>> do > >>>>>>>> that > >>>>>>>>>> using a separate field. You just index a numeric docvalues = field > >>>>>>>> (which may > >>>>>>>>>> contain a long or float value per document). Later you wrap = your > >>>>>>>> query with > >>>>>>>>>> some FunctionScoreQuery (e.g., use the Javascript function > query > >>>>>>>> syntax in > >>>>>>>>>> the expressions module). This allows you to compile a = javascript > >>>>>>>> function > >>>>>>>>>> that calculated the final score based on the score returned = by > the > >>>>>>>> inner query > >>>>>>>>>> and combines them with docvalues that were indexed per > >> document. > >>>>>>>>>>> Uwe > >>>>>>>>>>> > >>>>>>>>>>> ----- > >>>>>>>>>>> Uwe Schindler > >>>>>>>>>>> Achterdiek 19, D-28357 Bremen > >>>>>>>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> > 3A__www.thetaphi.de&d=3DDwIFaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIr > >>>>>>>>>> MUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > >>>>>>>>>> > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6rVk8db2H8dAcjS3WCWmAPd08C7JQCvZ > >> > 8W80yE9L5xY&s=3DzgKmnmP9gLG4DlEnAfDdtBMEzPXtHNVYojxXIKEnQgs&e=3D > >>>>>>>>>>> eMail: uwe@thetaphi.de > >>>>>>>>>>> > >>>>>>>>>>>> -----Original Message----- > >>>>>>>>>>>> From: baris.kazar@oracle.com > >>>>>>>>>>>> Sent: Friday, October 18, 2019 5:28 PM > >>>>>>>>>>>> To: java-user@lucene.apache.org > >>>>>>>>>>>> Cc: baris.kazar@oracle.com > >>>>>>>>>>>> Subject: Re: Index-time boosting: Deprecated setBoost > method > >>>>>>>>>>>> > >>>>>>>>>>>> It looks like index-time boosting (field) is not possible = since > >>>>>>>> Lucene > >>>>>>>>>>>> version 7.7.2 and > >>>>>>>>>>>> > >>>>>>>>>>>> i was using before for another case the BoostQuery at = search > >>>>>> time > >>>>>>>> for > >>>>>>>>>>>> boosting and > >>>>>>>>>>>> > >>>>>>>>>>>> this seems to be the only boosting option now in Lucene. > >>>>>>>>>>>> > >>>>>>>>>>>> Best regards > >>>>>>>>>>>> > >>>>>>>>>>>> > >>>>>>>>>>>> On 10/18/19 10:01 AM, baris.kazar@oracle.com wrote: > >>>>>>>>>>>>> Hi,- > >>>>>>>>>>>>> > >>>>>>>>>>>>> i saw this in the Field class docs and i am figuring out = the > >>>>>>>> following > >>>>>>>>>>>>> note in the docs: > >>>>>>>>>>>>> > >>>>>>>>>>>>> setBoost(float boost) > >>>>>>>>>>>>> Deprecated. > >>>>>>>>>>>>> Index-time boosts are deprecated, please index = index-time > >>>>>> scoring > >>>>>>>>>>>>> factors into a doc value field and combine them with the > score > >>>>>> at > >>>>>>>>>>>>> query time using eg. FunctionScoreQuery. > >>>>>>>>>>>>> > >>>>>>>>>>>>> I appreciate this note. Is there an example about this? = I wish > >>>>>>>> docs > >>>>>>>>>>>>> would give a simple example to further help. > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >>>>>>>>>> 3A__lucene.apache.org_core_6-5F6- > >>>>>>>>>> > >> > 5F0__core_org_apache_lucene_document_&d=3DDwIFaQ&c=3DRoP1YumCXCga > >>>>>>>>>> WHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > >>>>>>>>>> > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6rVk8db2H8dAcjS3WCWmAPd08C7JQCvZ > >> 8W80yE9L5xY&s=3DrIVbw3_TGEwpaet5ibCeYze6vSDUiPhwOzlV0z484fM&e=3D > >>>>>>>>>>>> Field.html > >>>>>>>>>>>>> vs > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >>>>>>>>>> 3A__lucene.apache.org_core_7-5F7- > >>>>>>>>>> > >> > 5F2_core_org_apache_lucene_document_F&d=3DDwIFaQ&c=3DRoP1YumCXCgaW > >>>>>>>>>> HvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > >>>>>>>>>> > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6rVk8db2H8dAcjS3WCWmAPd08C7JQCvZ > >> > 8W80yE9L5xY&s=3Dyt1toHHZQBqd3qKpWeSzywGJhy928Q5qaEO4v9Lj3vg&e=3D > >>>>>>>>>>>> ield.html > >>>>>>>>>>>>> Best regards > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>> = --------------------------------------------------------------------- > >>>>>>>>>>>> To unsubscribe, e-mail: java-user- > >> unsubscribe@lucene.apache.org > >>>>>>>>>>>> For additional commands, e-mail: > >>>>>> java-user-help@lucene.apache.org > >>>>>> = --------------------------------------------------------------------- > >>>>>>>>>>> To unsubscribe, e-mail: java-user- > >> unsubscribe@lucene.apache.org > >>>>>>>>>>> For additional commands, e-mail: java-user- > >> help@lucene.apache.org > >>>>>> = --------------------------------------------------------------------- > >>>>>>>>>> To unsubscribe, e-mail: java-user- > unsubscribe@lucene.apache.org > >>>>>>>>>> For additional commands, e-mail: java-user- > >> help@lucene.apache.org > >>>>>> = --------------------------------------------------------------------- > >>>>>>>>> To unsubscribe, e-mail: java-user- > unsubscribe@lucene.apache.org > >>>>>>>>> For additional commands, e-mail: java-user- > >> help@lucene.apache.org > >>>>>> = --------------------------------------------------------------------- > >>>>>>>> To unsubscribe, e-mail: = java-user-unsubscribe@lucene.apache.org > >>>>>>>> For additional commands, e-mail: java-user- > help@lucene.apache.org > >>>>>>> -- > >>>>>>> Uwe Schindler > >>>>>>> Achterdiek 19, 28357 Bremen > >>>>>>> > >>>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> > 3A__www.thetaphi.de&d=3DDwIFaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIr > >> MUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3D6ksT9ArMj83Yxf_GrxLNeJ4UFEeKdVdLK0Bl > >> OT0d754&s=3D33f2nq9rOLI5pN9e_RYl_TiEKnP_f4WMZ__vqyz2bzo&e=3D > >>>>>> > >>>>>> = --------------------------------------------------------------------- > >>>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >>>>>> For additional commands, e-mail: = java-user-help@lucene.apache.org > >>>>> -- > >>>>> Uwe Schindler > >>>>> Achterdiek 19, 28357 Bremen > >>>>> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- > >> > 3A__www.thetaphi.de&d=3DDwIFaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIr > >> MUB65eapI_JnE&r=3DnlG5z5NcNdIbQAiX- > >> > BKNeyLlULCbaezrgocEvPhQkl4&m=3DowjI40OeLzt8gvPN44aTdndoiUel5E9Hqx1T > >> EcoWk_Y&s=3DxbZedNkQXb5eQcw_K7lCOP7b5ToKJVZ1dCPY3hi836c&e=3D > >>> = --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >>> For additional commands, e-mail: java-user-help@lucene.apache.org > >>> > >> = --------------------------------------------------------------------- > >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >> For additional commands, e-mail: java-user-help@lucene.apache.org > > > > = --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > For additional commands, e-mail: java-user-help@lucene.apache.org > > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org