17. 17
01
Etsy Values
We are a mindful,
transparent, and
humane business.
We plan and build
for the long term.
We value
craftsmanship in
all we make.
We believe fun
should be part of
everything we do.
We keep it real,
always.
48. 48
01
Freshness is fun
public
SearchResults
diversify(SearchResults
results)
{
SearchResults
diversifiedResults;
int
nextWindow
=
diversityOptions.getWindow();
do
{
diversityOptions.window
=
nextWindow;
diversifiedResults
=
shopDiversifier.diversify(results);
DiversityStats
shopDiversity
=
diversifiedResults.docs.stream()
.collect(DiversityStatsCalculator.collector(ListingDoc::getShopId)).getStats();
//
if
the
results
are
sufficiently
diverse,
we're
done
if
(shopDiversity.getDiversityIndex()
<=
diversityOptions.progressive.getTargetDiversityIndex())
{
break;
}
//
otherwise,
broaden
the
window
and
re-‐try
nextWindow
=
Math.min(
diversifiedResults.totalCount,
Math.min(diversityOptions.getMaxWindow(),
diversityOptions.window
*
2)
);
}
while
(diversityOptions.window
<
nextWindow);
return
diversifiedResults;
}
49. 49
01
Freshness is fun
.
.
.
//
if
the
list
is
sufficiently
diverse,
we're
done
if
(shopDiversity.getDiversityIndex()
<=
diversityOptions.progressive.getTargetDiversityIndex())
{
break;
}
//
otherwise,
broaden
the
window
and
re-‐try
nextWindow
=
Math.min(
diversifiedResults.totalCount,
Math.min(diversityOptions.getMaxWindow(),
diversityOptions.window
*
2)
);
.
.
.
58. 58
01
Evaluating for stability
• RankDelta
• Web UI
• Allows user to specify query set, hosts and thrift params
in PHP code
• Provides high-level statistics about the results
• Plus full result set deep-dive
67. 67
01
Takeaways
• Minor changes to the default scoring can be powerful
• Handle quality contextually
• Conscious diversity serves both searcher & searchee
• Invest in a feedback loop on ranking changes
• Be honest but keep it consistent