我在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