Mais conteúdo relacionado Semelhante a Solr and Lucene at Etsy - By Gregg Donovan (20) Mais de lucenerevolution (20) Solr and Lucene at Etsy - By Gregg Donovan1. Solr & Lucene at Etsy
Gregg Donovan
Technical Lead, Search
gregg@etsy.com
2. 1.5 years Solr & Lucene at Etsy.com
3 years Solr & Lucene at TheLadders.com
29. schema.xml:
<fieldType name="file" keyField="treasury_id" defVal="0"
stored="false" indexed="true" class="solr.ExternalFileField"
valType="float"/>
<field name="hotness" type="file"/>
/search/data/treasury/external_hotness.1306390802088:
1=2.3
2=1.7
3=1.1
Solr query:
sort={!func}hotness+desc
56. export GC_DEBUG="-verbose:gc -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:
+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy -
XX:AdaptiveSizePolicyOutputInterval=1 -XX:+PrintTenuringDistribution -XX:
+PrintGCDetails -Xloggc:/var/log/search/gc.log"
65. Know the hooks
SolrRequestHandler
SearchComponent
QParserPlugin
SolrEventListener
SolrCache
ValueSourceParser
75. currency.xml:
<currencyConfig version="1.0">
! <currencies>
! ! <currency name="United States Dollar" symbol="$" code="USD"/>
! ! <currency name="Australian Dollar" symbol="$" code="AUD"/>
! ! <currency name="Canadian Dollar" symbol="$" code="CAD"/>
! ! <currency name="Czech Koruna" symbol="Kč" code="CZK"/>
...
! </currencies>
! <rates>
! ! <rate from="USD" to="AUD" rate="1.168750"/>
! ! <rate from="USD" to="CAD" rate="1.085000"/>
! ! <rate from="USD" to="CZK" rate="20.107500"/>
! ! <rate from="USD" to="DKK" rate="5.323750"/>
...
</rates>
</currencyConfig>
77. MoneyFieldType.java:
@Override
public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2,
final boolean minInclusive, final boolean maxInclusive) {
final MoneyValue p1 = MoneyValue.parse(part1, defaultCurrency);
final MoneyValue p2 = MoneyValue.parse(part2, defaultCurrency);
if (!p1.getCurrencyCode().equals(p2.getCurrencyCode())) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
new ParseException("Cannot parse range query " + part1 + " to " + part2 +
": range queries only supported when upper and lower bound have same
currency."));
}
String currencyCode = p1.getCurrencyCode();
final MoneyValueSource vs = new MoneyValueSource(field, currencyCode, parser);
return new SolrConstantScoreQuery(new ValueSourceRangeFilter(vs,
p1.getAmount() + "", p2.getAmount() + "", minInclusive, maxInclusive));
}
82. bjewlery dewelry ejewelry ejwelry ewelery ewerly ewlery fewelry
fewlery fjewelery fjewelry gewerly gewlery hewelery hewelry hewerly
hewlery hjewelry iewelry ijewelry jawelery jawlery jeawlery jeelery
jeelry jeewelery jeewelry jeewlery jeewlry jefwelry jejelry jelelry
jelery jellery jelwelery jelwelry jelwlery jemelry jemerly jemwelry
jeqwelry jerelery jerelry jerely jererly jerlery jerwelery jerwelry
jerwely jerwerly jeselery jeselry jevelry jeverly jewalery jewdelry
jewedlry jeweelrry jeweelry jeweely jeweer jeweery jeweilry jeweiry
jewejery jewejlry jewejrly jewejry jewekey jewekry jewelary jeweldy
jewele jewelee jewelelry jewelera jewelerey jewelerly jewelert
jewelerty jeweleru jeweleruy jeweleryl jewelerys jeweleryy jewelet
jewelety jeweleya jewelfry jewelfy jeweliy jewellryp jewelltry
jewelly jewelory jewelra jewelray jewelre jewelree jewelreyy
jewelrfy jewelrh jewelri jewelrky jewelrly jewelrr jewelrs jewelrsy
jewelrt jewelrty jewelru jewelruy jewelrye jewelryh jewelryl
jewelrym jewelryr jewelrys jewelryt jewelryu jewelryuk
jewelryy jewelrz jewelsry jewelsy jeweltry jewelty jewelw jewelwery
jewelwey jewelwy jewelya jewelyj jewelyr jewelyry jewelyu jewelyy
jewelzry jeweory jewerey jeweriy jewerky jewerlary jewerley jewerli
jewerlly jewerls jewerlt jewerlu jewerlyh jewerlyr jewerlys jewerlyu
jewerry jeweryl jewetry jewewlry jewewly jewewrly jewewry jeweylry
jewiery jewilary jewkery jewlary jewledy jewleery jewlelery jewlely