Umer
Umer

Reputation: 1921

SOLR ignoring comma and other punctuation while searching

I want to search 100,000 and 100000 only by querying 100000 (or only by querying 100,000).
Is it possible to search like that.

The purpose to perform this is, that user may add a comma at any place or no comma at all but the strings (100,000 or 100000) should be searched anyway...

Upvotes: 0

Views: 3582

Answers (3)

Juampa
Juampa

Reputation: 154

Try using solr.WordDelimiterFilterFactory with catenateNumbers="1" in the index and query definition of you field.

You have some docs here: WordDelimiterFactory

Upvotes: 6

Karussell
Karussell

Reputation: 17375

just remove the , from the query if it is in a number

(if you are using java at the client -> parse the number and do toString)

Upvotes: 0

Joyce
Joyce

Reputation: 1451

Don't know if this is correct, but maybe you can write some kind of filter factory where numbers are always indexed as numbers formatted with commas and with out commas. Or you can have both the index & query analyzer store the word w/o comma.

Upvotes: 1

Related Questions