berkeleybop / bbop-manager-golr

Manager for handling communication and callbacks with GOlr instances.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Set a default boost value #2

Open jnguyenx opened 7 years ago

jnguyenx commented 7 years ago

In the yaml config file, defined a field without any boost as: boost_weights: taxon_searchable

will generate a query which is not valid, with boosting: taxon_searchable^NaN

Ideally a default boosting of 1 should be present instead.

kltm commented 7 years ago

Ah--I thought you had nothing here (e.g. a blank boost line). Am I correct that you're actually inputting "NaN", as per your example?

jnguyenx commented 7 years ago

Oops missed copy/paste, I edited the text.

Actually instead of having 1 as default boost, it can just be left without any boost, it's a valid query.

qf: [
"label_searchable^1",
"definition_searchable^1",
"synonym_searchable^1",
"iri_searchable^2",
"id_searchable^2",
"taxon_searchable"
],
kltm commented 7 years ago

Ah yes, that's a boog then--it should error earlier or give a default value. Playing with NaN a second ago:

> isNaN(NaN)
true
> isFinite(NaN)
false
> typeof(NaN)
'number'
> typeof(1)
'number'
> NaN/NaN
NaN
> 1/NaN
NaN
> 1/0
Infinity

That. Is. So. Wrong.