Indexing terms which contain a dash character

What is the preferred way to deal with the dash character when indexing nodes using
I'm following this tutorial:

I have several thousand product identifiers in the format "123456-0023" where the first six digits identify the product, and the last four digits a variant. When querying my index with the exact string of one product variant, the result set contained one article with "123456" and all variants with "0023" (several hundred) which leads to the conclusion that lucene treated 123456 and 0023 as individual terms. How can I index my product identifiers in such a way that the whole string is treated as a unit?

Oh, I see. I need to use the 'keyword' analyzer, as I suspected.

This is also a good resource if you haven't already run across it.

1 Like

Thanks, that looks interesting!