What you are missing is a fundamental part of how Lucene and hence Solr performs its' searches. Solr does not search, but it looks the tokens (words) of a search up in the index that has been created for a certain set of documents. Such an index is - very simplified - like the index at end of every book. You can look up there where each word is placed within the actual text.
Currently your field name is not tokenized at all, as you use the fieldType string. This means that the whole content of that field is indexed as one word. This is a problem, as you have already noticed.
When you now search for paris
, Solr takes a look into the index and searches if the token paris
exists there. But that is not the case. Taking the two examples you have posted, your index consist of two entries
Ici Paris XL geschenkset aanbieding
De tuinen geschenkset aanbieding
Each of those entries needs to be equal to paris
- from the front to the end - in order to produce a hit. This is not the case. So you surrounded paris with the wildcard *
. This makes Solr have a look into each entry of the index, this will result in very, very, very bad performance.
So what should you do to tackle this? Start tokenizing! This is described rather good in the official documentation or in the Solr Tutorial.
In the end you will add a custom fieldType in your schema.xml, similar to this one
<fieldType name="text_general" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
Then you will need to change the fielType of your field name to that new fielType and you are required to rebuild your index.
Then your index will contain more entries for the field name, not like above just two, but these ones
- ici
- paris
- xl
- geschenkset
- aanbieding
- de
- tuinen
Then you can query for "paris xl"
. Take a note at the apostrophs before and after the search. This makes Solr perform a phrase query, so it will only produce a hit only if paris
is followed by xl
.