Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr Tokenizer Injection

Tags:

solr

tokenize

As an example I have a text field that might contain the following string:

"d7199^^==^^81^^==^^A sentence or two!!"

I want to tokenize this data but have each token contain the first part of the string. So, I'd like the tokens to look like this for the example above:

"d7199^^==^^81^^==^^a"

"d7199^^==^^81^^==^^sentence"

"d7199^^==^^81^^==^^or"

"d7199^^==^^81^^==^^two"

How would I go about doing this?

like image 611
Jason Palmer Avatar asked Nov 13 '22 18:11

Jason Palmer


1 Answers

You can implement your own custom Tokenizer and add it to the Solr classpath. Then use it in your Solr schema.xml and solrconfig.xml

like image 120
Karl-Bjørnar Øie Avatar answered Dec 21 '22 18:12

Karl-Bjørnar Øie