--- a/schema.xml
+++ b/schema.xml
@@ -218,6 +218,86 @@
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- A general unstemmed text field - good if one does not know the language of the field -->
+ <fieldType name="textgen" class="solr.TextField" positionIncrementGap="100">
+ <analyzer type="index">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.StopFilterFactory"
+ ignoreCase="true"
+ words="stopwords.txt"
+ enablePositionIncrements="true"
+ />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- A general unstemmed text field that indexes tokens normally and also
+ reversed (via ReversedWildcardFilterFactory), to enable more efficient
+ leading wildcard queries. -->
+ <!--
+ <fieldType name="text_rev" class="solr.TextField" positionIncrementGap="100">
+ <analyzer type="index">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
+ maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.StopFilterFactory"
+ ignoreCase="true"
+ words="stopwords.txt"
+ enablePositionIncrements="true"
+ />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+ -->
+
+ <!-- charFilter + WhitespaceTokenizer -->
+ <!--
+ <fieldType name="textCharNorm" class="solr.TextField" positionIncrementGap="100" >
+ <analyzer>
+ <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ </analyzer>
+ </fieldType>
+ -->
+
+ <!-- This is an example of using the KeywordTokenizer along
+ With various TokenFilterFactories to produce a sortable field
+ that does not include some properties of the source text
+ -->
+
+ <!--
+ <fieldtype name="payloads" stored="false" indexed="true" class="solr.TextField" >
+ <analyzer>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
+ </analyzer>
+ </fieldtype>
+ -->
+
+ <!-- lowercases the entire field value, keeping it as a single token. -->
+ <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
+ <filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
@@ -317,6 +397,53 @@
<field name="rating" type="float" indexed="true" stored="true" />
<field name="review_count" type="integer" indexed="true" stored="true" />
+ <field name="id" type="string" indexed="true" stored="true" required="true" />
+ <field name="sku" type="textTight" indexed="true" stored="true" omitNorms="true"/>
+ <field name="alphaNameSort" type="alphaOnlySort" indexed="true" stored="false"/>
+ <field name="manu" type="textgen" indexed="true" stored="true" omitNorms="true"/>
+ <field name="cat" type="text_ws" indexed="true" stored="true" multiValued="true" omitNorms="true" />
+ <field name="features" type="text" indexed="true" stored="true" multiValued="true"/>
+ <field name="includes" type="text" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
+
+ <field name="weight" type="float" indexed="true" stored="true"/>
+ <field name="price" type="float" indexed="true" stored="true"/>
+ <field name="popularity" type="int" indexed="true" stored="true" />
+ <field name="inStock" type="boolean" indexed="true" stored="true" />
+
+ <!-- Common metadata fields, named specifically to match up with
+ SolrCell metadata when parsing rich documents such as Word, PDF.
+ Some fields are multiValued only because Tika currently may return
+ multiple values for them.
+ -->
+ <field name="title" type="text" indexed="true" stored="true" multiValued="true"/>
+ <field name="subject" type="text" indexed="true" stored="true"/>
+ <field name="comments" type="text" indexed="true" stored="true"/>
+ <field name="author" type="textgen" indexed="true" stored="true"/>
+ <field name="keywords" type="textgen" indexed="true" stored="true"/>
+ <field name="category" type="textgen" indexed="true" stored="true"/>
+ <field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
+ <field name="last_modified" type="date" indexed="true" stored="true"/>
+ <field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
+
+
+ <!-- catchall field, containing all other searchable text fields (implemented
+ via copyField further on in this schema -->
+ <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
+
+ <!-- catchall text field that indexes tokens both normally and in reverse for efficient
+ leading wildcard queries. -->
+ <!--
+ <field name="text_rev" type="text_rev" indexed="true" stored="false" multiValued="true"/>
+ -->
+
+ <!-- non-tokenized version of manufacturer to make it easier to sort or group
+ results by manufacturer. copied from "manu" via copyField -->
+ <field name="manu_exact" type="string" indexed="true" stored="false"/>
+
+ <!--
+ <field name="payloads" type="payloads" indexed="true" stored="true"/>
+ -->
+
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
will be used if the name matches any of the patterns.
RESTRICTION: the glob-like pattern in the name attribute must have
@@ -355,10 +482,22 @@
<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
-->
- <uniqueKey>project_doc_id</uniqueKey>
+ <uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>description</defaultSearchField>
+ <defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>
+
+ <!-- copyField commands copy one field to another at the time a document
+ is added to the index. It's used either to index the same field differently,
+ or to add multiple fields to the same field for easier/faster searching. -->
+
+ <copyField source="cat" dest="text"/>
+ <copyField source="name" dest="text"/>
+ <copyField source="manu" dest="text"/>
+ <copyField source="features" dest="text"/>
+ <copyField source="includes" dest="text"/>
+ <copyField source="manu" dest="manu_exact"/>
+
</schema>