0

We have used StandardTokenizerFactory in the solr. but we have faced issue when we have search without special character.

Like we have search "What’s the Score?" and its content special character. now we have only search with "Whats the Score" but we didn't get proper result. its means search title with and without special character should we work.

Please suggest which Filter we need to use and satisfy both condition.

1 Answers1

0

If you have a recent version of Solr, try adding to your analyzer chain solr.WordDelimiterGraphFilterFactory having catenateWords=1.

This starting from What's should create three tokens What, s and Whats.

Not sure if ' is in the list of characters used by filter to concatenate words, in any case you can add it using the parameter types="characters.txt"

freedev
  • 25,946
  • 8
  • 108
  • 125
  • we have implemented you suggestion but its work without "Whats the Score?" but it is not working on exact match ("What’s the Score?"). Please suggest both are work. – Samir Parmar Apr 26 '17 at 11:16
  • Please mark this answer (if it is) as correct and make another question on SO. – freedev Apr 26 '17 at 11:17
  • solr.WordDelimiterGraphFilterFactory its only satisfied one condition but Exact match its not working. – Samir Parmar Apr 26 '17 at 11:23
  • *Exact match is a complicated issue in Solr, largely because there are varying degrees of "exactitude", and a truly exact match is rarely desirable in real life.* Have a look at http://stackoverflow.com/questions/29103155/solr-exact-match-boost-over-text-containing-the-exact-match – freedev Apr 26 '17 at 11:39
  • I also suggest to use the analyser embedded into the Solr Admin to understand what's going on and debug your query, you also could use [Solr Query Debugger](https://chrome.google.com/webstore/detail/solr-query-debugger/gmpkeiamnmccifccnbfljffkcnacmmdl) which I wrote – freedev Apr 26 '17 at 11:42