This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Category { | |
| private String name; | |
| public Category() { | |
| name = "" + Math.random(); | |
| } | |
| public List<Category> getChildCategories() { | |
| List<Category> childCategories = new ArrayList<>(); | |
| for(int i=0; i<20; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- persistent="true" allows the web interface to make lasting changes to Solr. --> | |
| <solr persistent="true" sharedlib="lib"> | |
| <cores adminpath="/admin/cores" host="${host:}" hostcontext="${hostContext:}" hostport="${jetty.port:}" zkclienttimeout="${zkClientTimeout:15000}"> | |
| <core default="true" instancedir="auctions" name="auctions"> | |
| </core></cores> | |
| </solr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <doc> | |
| <field name="auction_id">54432834</field> | |
| <field name="title">Dell M2012 24" IPS Monitor</field> | |
| <field name="category">monitors</field> | |
| <field name="current_bid">279.95</field> | |
| <field name="end_date">2013-01-06T09:26:04.18Z</field> | |
| <field name="feature">IPS</field> | |
| <field name="feature">Swivel</field> | |
| </doc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <schema name="example" version="1.5"> | |
| <fields> | |
| <field name="_version_" type="long" indexed="true" stored="true" required="true"/> | |
| <field name="auction_id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="title" type="text_en" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="category" type="string" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="current_bid" type="currency" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="end_date" type="date" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="feature" type="string" indexed="true" stored="true" required="false" multiValued="true" /> | |
| </fields> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <schema name="example" version="1.5"> | |
| <fields> | |
| <field name="title" type="text_en" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="category" type="string" indexed="true" stored="true" required="true" multiValued="false" /> | |
| <field name="feature" type="string" indexed="true" stored="true" required="false" multiValued="true" /> | |
| <field name="allText" type="text_en" indexed="true" stored="false" required="true" multiValued="true" /> | |
| </fields> | |
| <copyField source="title" dest="allText" /> | |
| <copyField source="category" dest="allText" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100"> | |
| <analyzer type="index"> | |
| <tokenizer class="solr.StandardTokenizerFactory"/> | |
| <filter class="solr.StopFilterFactory" | |
| ignoreCase="true" | |
| words="lang/stopwords_en.txt" | |
| enablePositionIncrements="true" | |
| /> | |
| <filter class="solr.LowerCaseFilterFactory"/> | |
| <filter class="solr.EnglishPossessiveFilterFactory"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- What an auction might look like in its original XML form: --> | |
| <auction> | |
| <title>Desktop PC</title> | |
| <feature> | |
| <name>RAM</name> | |
| <value>16 GB</value> | |
| </feature> | |
| <feature> | |
| <name>CPU Frequency</name> | |
| <value>4.5 GHz</value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- in solrconfig.xml --> | |
| <requestHandler name="/update" class="solr.UpdateRequestHandler" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- original XML format: --> | |
| <auction> | |
| <auction_id>54432834</auction_id> | |
| <title>Dell M2012 24" IPS Monitor</title> | |
| <category>monitors</category> | |
| <current_bid>279.95</current_bid> | |
| </auction> | |
| <!-- The format Solr requires: --> | |
| <doc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!-- the 2.0 version of xsl reqires a custom processor to be used. Saxon9he is used, and is | |
| located in Jetty's ext/ folder. This library requires Jetty to be started like so: | |
| java -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl -jar start.jar | |
| --> | |
| <xsl:stylesheet version="2.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:fn="http://www.w3.org/2005/xpath-functions" |