Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions solr/cores/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

<fieldType name="random" class="solr.RandomSortField" indexed="true" />

<!-- For general text with ngram for flexible search -->
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
Expand All @@ -66,29 +67,34 @@
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
<!-- Just like text_general except it reverses the characters of
each token, to enable more efficient leading wildcard queries. -->
<fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">

<!-- Exact match text field with term vectors -->
<fieldType name="text_vector" class="solr.TextField" positionIncrementGap="100" termVectors="true">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of termVectors = true here? What is our current use-case for them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I removed that. It was originally used for experimenting with highlighting matched parts, and I forgot to clear it.

<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true" maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory" />
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>



<fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />

<!-- Define the new text field for queries -->
<field name="text" type="text_general" indexed="true" stored="true" multiValued="true"/>
<!-- Define the new text field for ngram queries -->
<field name="text_ngram" type="text_general" indexed="true" stored="false" multiValued="true"/>

<!-- Define the new text field for exact match queries -->
<field name="text_exact" type="text_vector" indexed="true" stored="false" multiValued="true"/>

<!-- Define the field for storing the thumbnail URL -->
<field name="thumbnail_url" type="string" stored="true" indexed="false" />

<!-- Copy field directives for aggregating values into the text field -->
<copyField source="wikidata_id_s" dest="text"/>
<copyField source="*_ss" dest="text" />
<copyField source="*_ss" dest="text_ngram" />

<copyField source="wikidata_id_s" dest="text_exact"/>
<copyField source="*_ss" dest="text_exact" />
</schema>
5 changes: 4 additions & 1 deletion solr/cores/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="df">text</str>
<str name="defType">edismax</str>
<str name="df">text_exact text_ngram</str>
Comment thread
ahankinson marked this conversation as resolved.
Outdated
<str name="qf">text_exact^2 text_ngram</str>
</lst>
</requestHandler>


<!-- A request handler that returns indented JSON by default -->
<requestHandler name="/query" class="solr.SearchHandler">
<lst name="defaults">
Expand Down