Indexing terms which contain a dash character

What is the preferred way to deal with the dash character when indexing nodes using
db.index.fulltext.createNodeIndex()?
I'm following this tutorial: https://blog.grandstack.io/using-neo4js-full-text-search-with-graphql-e3fa484de2ea

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. https://graphaware.com/neo4j/2019/01/11/neo4j-full-text-search-deep-dive.html

1 Like

Thanks, that looks interesting!