The configuration for the demo application can be found at: https://github.com/javasoze/sensei/tree/master/conf, which contains the following files:
sensei.properties
: main
configuration file, describes the overall configuration of the
system (we will dig into that in detail later)
schema.xml
: this describes the data
model and the faceting behavior of the application
custom-facets.xml
: Spring file for
adding custom facets, while Sensei comes with a set of facet
types out of the box, this allows user-defined facets to be
plugged into the application
plugins.xml
: any other plug-ins,
e.g. Analyzer, Similarity, and Interpreter.
The data model is described in
schema.xml
:
<table uid="id" delete-field="" skip-field=""> <column name="color" type="string" /> <column name="category" type="string" /> <column name="city" type="string" /> <column name="makemodel" type="string" /> <column name="year" type="int" /> <column name="price" type="float" /> <column name="mileage" type="int" /> <column name="tags" type="string" multi="true" delimiter=","/> <column name="contents" type="text" index="ANALYZED" store="NO" termvector="NO" /> </table> <facets> <facet name="color" type="simple" depends=""/> <facet name="category" type="simple" /> <facet name="city" type="path"> <params> <param name="separator" value="/" /> </params> </facet> <facet name="makemodel" type="path" /> <facet name="year" type="range"> <params> <param name="range" value="1993-1994" /> <param name="range" value="1995-1996" /> <param name="range" value="1997-1998" /> <param name="range" value="1999-2000" /> <param name="range" value="2001-2002" /> </params> </facet> <facet name="mileage" type="range"> <params> <param name="range" value="*-12500" /> <param name="range" value="12501-15000" /> <param name="range" value="15001-17500" /> <param name="range" value="17501-*" /> </params> </facet> <facet name="price" type="range"> <params> <param name="range" value="*,6700" /> <param name="range" value="6800,9900" /> <param name="range" value="10000,13100" /> <param name="range" value="13200,17300" /> <param name="range" value="17400,*" /> </params> </facet> <facet name="tags" type="multi" /> </facets>
This corresponds to the following data table:
color | category | city | makemodel | year | price | mileage | tags | contents | ||
---|---|---|---|---|---|---|---|---|---|---|
meta/structured | yes | yes | yes | yes | yes | yes | yes | yes | no | |
type | string | string | string | string | int | float | int | string | text | |
facet | simple | simple | path | path | range | range | range | multi | N/A |