I\'m currently developping a search engine using Solr for an ecommerce website. So I get these two fields in my schema.xml:
You'll need a copyField
setting for the fields you want to be searchable by default.
Since your defaultSearchField
is set to global
, try:
You'll probably want to do the same for collection
:
In order to have partial matches (e.g.: ?q=95) without special operators, you need to tweak the NGram filter. Your current setting, for both the index-time and the query-time analyzer is:
This means that partial matching will be available from 3 to 6 characters, per example:
If you want to allow it from 2 characters (e.g.: 95
), change the minGramSize
in both analyzers' filters and you should be good to go:
Lastly, your global
field probably shouldn't be stored (by default) but only indexed:
Remember that you need to restart Solr and re-index for the changes to be in effect.