cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Indexing terms which contain a dash character

pingelsan
Node Clone

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?

1 ACCEPTED SOLUTION

pingelsan
Node Clone

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

View solution in original post

3 REPLIES 3

pingelsan
Node Clone

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

MuddyBootsCode
Graph Steward

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

Thanks, that looks interesting!