ErikaW
ErikaW

Reputation: 23

Apache Solr: How to deal with words composed with numbers

If I search for any of the following I get the exact sames results:

How can I force Solr to care about the number following a word?

I tried to add them in the prodwords.txt, or the spellings.txt but it had no impact, and can't find any useful tip on google.

I'm using Solr 4.6 and have the default Drupal Search API Solr search schema.xml with as only difference that I removed the stemming option.


Working solution:

To have the field working with this kind of keywords I needed to set minimum token length to 1:

<filter class="solr.LengthFilterFactory" min="1" max="100" />

But also have these configurations for the WordDelimiterFilterFactory

Upvotes: 1

Views: 531

Answers (1)

tahagh
tahagh

Reputation: 807

The problem is in the configuration of fieldType "text" (or other fieldTypes with the similar configuration) in schema.xml file. The minimum length for a token is set to 2:

<filter class="solr.LengthFilterFactory" min="2" max="100" />

So all your tokens with length one will be removed.

Upvotes: 1

Related Questions