我在Azure搜索中具有3个相同(在Text中)项目的集合,因价格和点数而异。价格更便宜的产品价格上涨。 (价格上涨多了点,反而上涨)。Azure搜索得分
但是,我一直看到类似这样的搜索结果。
搜索是在'约翰米尔顿'。
我得到
Product="Id = 2-462109171829-1, Price=116.57, Points= 7, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=32.499783
Product="Id = 2-462109171829-2, Price=116.40, Points= 9, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=32.454872
Product="Id = 2-462109171829-3, Price=115.64, Points= 9, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=32.316270
我希望进球为了这样的事情,用最低的价格第一。
Product="Id = 2-462109171829-3, Price=115.64, Points= 9, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=
Product="Id = 2-462109171829-2, Price=116.40, Points= 9, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=
Product="Id = 2-462109171829-1, Price=116.57, Points= 7, Name=Life of Schamyl/John Milton Mackie, Description=.", Score=
我缺少什么或者是小的评分变化可接受?
该指数定义为
let ProductDataIndex =
let fields =
[|
new Field (
"id",
DataType.String,
IsKey = true,
IsSearchable = true);
new Field (
"culture",
DataType.String,
IsSearchable = true);
new Field (
"gran",
DataType.String,
IsSearchable = true);
new Field (
"name",
DataType.String,
IsSearchable = true);
new Field (
"description",
DataType.String,
IsSearchable = true);
new Field (
"price",
DataType.Double,
IsSortable = true,
IsFilterable = true)
new Field (
"points",
DataType.Int32,
IsSortable = true,
IsFilterable = true)
|]
let weightsText =
new TextWeights(
Weights = ([|
("name", 4.);
("description", 2.)
|]
|> dict))
let priceBoost =
new MagnitudeScoringFunction(
new MagnitudeScoringParameters(
BoostingRangeStart = 1000.0,
BoostingRangeEnd = 0.0,
ShouldBoostBeyondRangeByConstant = true),
"price",
10.0)
let pointsBoost =
new MagnitudeScoringFunction(
new MagnitudeScoringParameters(
BoostingRangeStart = 0.0,
BoostingRangeEnd = 10000000.0,
ShouldBoostBeyondRangeByConstant = true),
"points",
2.0)
let scoringProfileMain =
new ScoringProfile (
"main",
TextWeights =
weightsText,
Functions =
new List<ScoringFunction>(
[
priceBoost :> ScoringFunction
pointsBoost :> ScoringFunction
]),
FunctionAggregation =
ScoringFunctionAggregation.Sum)
new Index
(Name = ProductIndexName
,Fields = fields
,ScoringProfiles = new List<ScoringProfile>(
[
scoringProfileMain
]))
嗨Hocho,快速澄清问题,索引中有多少文档?文件数量较少的索引中的评分可能稍微偏低。这是他们如何在内部组织的结果,以实现分布式服务的高效扩展和缩减。 – Yahnoosh
3000万文件。我正在做一些概念验证测试,因此除了识别字段以及分别在10%的范围内随机生成的价格和点数字段以外,所有相同的字段都会复制3次。 – hocho
谢谢!当您发出选择性较低的查询时,您是否看到相同的行为?例如:“John”(假设您的数据集中有多个John) – Yahnoosh