any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
The following page says:

http://lucene.apache.org/core/6_6_0/core/org/apache/lucene/document/Field.html#setBoost-float-

setBoost
@Deprecated
public void 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.
Sets the boost factor on this field.
Throws:
IllegalArgumentException - if this field is not indexed, or if it omits
norms.
See Also:
boost()


Any example on how to use FunctionScoreQuery? How will this affect the
IndexWriter?

Best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
https://stackoverflow.com/questions/50952727/ho-to-use-functionscorequery-with-text-fields

Somebody else was also asking this.

Best regards


On 7/31/18 3:56 PM, [hidden email] wrote:

> The following page says:
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lucene.apache.org_core_6-5F6-5F0_core_org_apache_lucene_document_Field.html-23setBoost-2Dfloat-2D&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=H84wcaVfvkqP3ETnAfp_RxC-6PuQiiYqEjrzF5ICHd4&s=kU3oMyexzzTU64Pxf535gQpxLP4GtRjMQ4CjmZbhPS4&e= 
>
>
> setBoost
> @Deprecated
> public void 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.
> Sets the boost factor on this field.
> Throws:
> IllegalArgumentException - if this field is not indexed, or if it
> omits norms.
> See Also:
> boost()
>
>
> Any example on how to use FunctionScoreQuery? How will this affect the
> IndexWriter?
>
> Best regards
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

Robert Muir
In reply to this post by baris.kazar
Does this example help?
https://lucene.apache.org/core/7_4_0/expressions/org/apache/lucene/expressions/Expression.html


On Tue, Jul 31, 2018 at 3:56 PM,  <[hidden email]> wrote:

> The following page says:
>
> http://lucene.apache.org/core/6_6_0/core/org/apache/lucene/document/Field.html#setBoost-float-
>
> setBoost
> @Deprecated
> public void 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.
> Sets the boost factor on this field.
> Throws:
> IllegalArgumentException - if this field is not indexed, or if it omits
> norms.
> See Also:
> boost()
>
>
> Any example on how to use FunctionScoreQuery? How will this affect the
> IndexWriter?
>
> Best regards
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
Robert,

thanks, this is helpful but why did this change when it was great to
use? SortField is a new concept to me  and i am not sure this is avail
in 6.6.0 but will check.

This new way seems more tricky.

if there are more examples, i will be happier :)

Best regards


On 7/31/18 6:19 PM, Robert Muir wrote:

> Does this example help?
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_7-5F4-5F0_expressions_org_apache_lucene_expressions_Expression.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=HH5zhMFzM1dkMQEXFfwogr-1hW3EwBdkIqa6LrjDzxw&e=
>
>
> On Tue, Jul 31, 2018 at 3:56 PM,  <[hidden email]> wrote:
>> The following page says:
>>
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lucene.apache.org_core_6-5F6-5F0_core_org_apache_lucene_document_Field.html-23setBoost-2Dfloat-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=bIqHxtrAh8BDauE0OQYMZfShyjlwFj2wa253wIKF3TY&e=
>>
>> setBoost
>> @Deprecated
>> public void 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.
>> Sets the boost factor on this field.
>> Throws:
>> IllegalArgumentException - if this field is not indexed, or if it omits
>> norms.
>> See Also:
>> boost()
>>
>>
>> Any example on how to use FunctionScoreQuery? How will this affect the
>> IndexWriter?
>>
>> Best regards
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
i have one MultiFieldQueryParser based Query and one BooleanQuery with
dynamic number of TermQuery's.

i dont have SortField objects. Are there examples with the above query
types please?

Best regards


On 7/31/18 7:59 PM, [hidden email] wrote:

> Robert,
>
> thanks, this is helpful but why did this change when it was great to
> use? SortField is a new concept to me  and i am not sure this is avail
> in 6.6.0 but will check.
>
> This new way seems more tricky.
>
> if there are more examples, i will be happier :)
>
> Best regards
>
>
> On 7/31/18 6:19 PM, Robert Muir wrote:
>> Does this example help?
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_7-5F4-5F0_expressions_org_apache_lucene_expressions_Expression.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=HH5zhMFzM1dkMQEXFfwogr-1hW3EwBdkIqa6LrjDzxw&e= 
>>
>>
>>
>> On Tue, Jul 31, 2018 at 3:56 PM,  <[hidden email]> wrote:
>>> The following page says:
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lucene.apache.org_core_6-5F6-5F0_core_org_apache_lucene_document_Field.html-23setBoost-2Dfloat-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=bIqHxtrAh8BDauE0OQYMZfShyjlwFj2wa253wIKF3TY&e= 
>>>
>>>
>>> setBoost
>>> @Deprecated
>>> public void 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.
>>> Sets the boost factor on this field.
>>> Throws:
>>> IllegalArgumentException - if this field is not indexed, or if it omits
>>> norms.
>>> See Also:
>>> boost()
>>>
>>>
>>> Any example on how to use FunctionScoreQuery? How will this affect the
>>> IndexWriter?
>>>
>>> Best regards
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
These methods look promising in terms of ease of use of
FunctionscoreQuery but they dont exist in Lucene 6.6.0.

static FunctionScoreQuery    boostByQuery(Query in, Query boostMatch,
float boostValue)
Returns a FunctionScoreQuery where the scores of a wrapped query are
multiplied by a boost factor if the document being scored also matches a
separate boosting query.
static FunctionScoreQuery    boostByValue(Query in, DoubleValuesSource
boost)
Returns a FunctionScoreQuery where the scores of a wrapped query are
multiplied by the value of a DoubleValuesSource.

Best regards


On 8/1/18 12:10 PM, [hidden email] wrote:

> i have one MultiFieldQueryParser based Query and one BooleanQuery with
> dynamic number of TermQuery's.
>
> i dont have SortField objects. Are there examples with the above query
> types please?
>
> Best regards
>
>
> On 7/31/18 7:59 PM, [hidden email] wrote:
>> Robert,
>>
>> thanks, this is helpful but why did this change when it was great to
>> use? SortField is a new concept to me  and i am not sure this is
>> avail in 6.6.0 but will check.
>>
>> This new way seems more tricky.
>>
>> if there are more examples, i will be happier :)
>>
>> Best regards
>>
>>
>> On 7/31/18 6:19 PM, Robert Muir wrote:
>>> Does this example help?
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_7-5F4-5F0_expressions_org_apache_lucene_expressions_Expression.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=HH5zhMFzM1dkMQEXFfwogr-1hW3EwBdkIqa6LrjDzxw&e= 
>>>
>>>
>>>
>>> On Tue, Jul 31, 2018 at 3:56 PM, <[hidden email]> wrote:
>>>> The following page says:
>>>>
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lucene.apache.org_core_6-5F6-5F0_core_org_apache_lucene_document_Field.html-23setBoost-2Dfloat-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=bIqHxtrAh8BDauE0OQYMZfShyjlwFj2wa253wIKF3TY&e= 
>>>>
>>>>
>>>> setBoost
>>>> @Deprecated
>>>> public void 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.
>>>> Sets the boost factor on this field.
>>>> Throws:
>>>> IllegalArgumentException - if this field is not indexed, or if it
>>>> omits
>>>> norms.
>>>> See Also:
>>>> boost()
>>>>
>>>>
>>>> Any example on how to use FunctionScoreQuery? How will this affect the
>>>> IndexWriter?
>>>>
>>>> Best regards
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: any example on FunctionScoreQuery since Field.setBoost is deprecated with Lucene 6.6.0

baris.kazar
Someone else also asked:
http://lucene.472066.n3.nabble.com/index-time-field-level-boosting-in-6-6-0-td4351797.html

Best regards

On 8/1/18 5:12 PM, [hidden email] wrote:

> These methods look promising in terms of ease of use of
> FunctionscoreQuery but they dont exist in Lucene 6.6.0.
>
> static FunctionScoreQuery    boostByQuery(Query in, Query boostMatch,
> float boostValue)
> Returns a FunctionScoreQuery where the scores of a wrapped query are
> multiplied by a boost factor if the document being scored also matches
> a separate boosting query.
> static FunctionScoreQuery    boostByValue(Query in, DoubleValuesSource
> boost)
> Returns a FunctionScoreQuery where the scores of a wrapped query are
> multiplied by the value of a DoubleValuesSource.
>
> Best regards
>
>
> On 8/1/18 12:10 PM, [hidden email] wrote:
>> i have one MultiFieldQueryParser based Query and one BooleanQuery
>> with dynamic number of TermQuery's.
>>
>> i dont have SortField objects. Are there examples with the above
>> query types please?
>>
>> Best regards
>>
>>
>> On 7/31/18 7:59 PM, [hidden email] wrote:
>>> Robert,
>>>
>>> thanks, this is helpful but why did this change when it was great to
>>> use? SortField is a new concept to me  and i am not sure this is
>>> avail in 6.6.0 but will check.
>>>
>>> This new way seems more tricky.
>>>
>>> if there are more examples, i will be happier :)
>>>
>>> Best regards
>>>
>>>
>>> On 7/31/18 6:19 PM, Robert Muir wrote:
>>>> Does this example help?
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_7-5F4-5F0_expressions_org_apache_lucene_expressions_Expression.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=HH5zhMFzM1dkMQEXFfwogr-1hW3EwBdkIqa6LrjDzxw&e= 
>>>>
>>>>
>>>>
>>>> On Tue, Jul 31, 2018 at 3:56 PM, <[hidden email]> wrote:
>>>>> The following page says:
>>>>>
>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lucene.apache.org_core_6-5F6-5F0_core_org_apache_lucene_document_Field.html-23setBoost-2Dfloat-2D&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=c3uQ0PZh3UAyhspJjYEWBQFj5P3kOZ2hutwoKfuVi0Y&s=bIqHxtrAh8BDauE0OQYMZfShyjlwFj2wa253wIKF3TY&e= 
>>>>>
>>>>>
>>>>> setBoost
>>>>> @Deprecated
>>>>> public void 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.
>>>>> Sets the boost factor on this field.
>>>>> Throws:
>>>>> IllegalArgumentException - if this field is not indexed, or if it
>>>>> omits
>>>>> norms.
>>>>> See Also:
>>>>> boost()
>>>>>
>>>>>
>>>>> Any example on how to use FunctionScoreQuery? How will this affect
>>>>> the
>>>>> IndexWriter?
>>>>>
>>>>> Best regards
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]