I am searching some phrase in Solr
of Name
field. I tryed different comfigurations for Name
, to be of type string
or any custom TextField
.
<fieldType name="string" class="solr.StrField" sortMissingLast="true"
docValues="true" />
<fieldType name="alphaOnlySort" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" replace="all"
replacement="" pattern="([^a-z])"/>
</analyzer>
</fieldType>
I defined Name
like this:
then tried like string:
Also I tried different tokenizers and filters combinations without success.
This is what I want: I have phrase 'test split' and I have some entries that have Name 'test'
, 'test 124'
,'testblablabla'
and 'test split 124'
.
What I find out is that 'test'
entry is first match in my example,and 'test split' has much much lower ranking altought it has more matching letters.
Why is that??
I am testing using solr admin interface and my q (query) parametar is:
Name:
*
test split*
EDIT 1:
I also tryed to create copyField called ExactName which has this configuration:
<fieldType name="exact" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
and I search like this:
Name:*test split* OR (ExactName:*test split*)^5.0
Still 'test' comes much before 'test split' :(