问题
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...
回答1:
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.
回答2:
Try using solr.WordDelimiterFilterFactory with catenateNumbers="1" in the index and query definition of you field.
You have some docs here: WordDelimiterFactory
回答3:
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)
来源:https://stackoverflow.com/questions/4255172/solr-ignoring-comma-and-other-punctuation-while-searching