When searching for something with colon, returns 0 result

Hi!
In our productsearch we have a problem, when searching for something with colon in it. It returns no result. How do I fix this?
Ex. when searching for micro 4:3 we get no result but there is a product with that name.
And when searching for it were using:

filterTermClause.Tags.Add(new Tag(TagNames.Name, term) { AllowFuzzy = true, Boost =     boostProductName         });
filterTermClause.Tags.Add(new Tag(TagNames.Name, $"{term}*") { AllowFuzzy = true, Boost = boostProductN        ame });
filterTermClause.Tags.Add(new Tag(TagNames.Name, $"*{term}*") { AllowFuzzy = true, Boost = boostProductName });

Litium version: 6.2.2

You need to use another analyzer, the standard analyzer will split the text on more or less all characters that not is a letter, see https://docs.litium.com/documentation/architecture/search/analyzers how you use another analyzer.

1 Like

Oh ok, I missed that it said comma there.

I’ve changed it to

filterTermClause.Tags.Add(new Tag(TagNames.Name, term) { AllowFuzzy = true, Boost = boostProductName, Analyzer = "whitespace" });
filterTermClause.Tags.Add(new Tag(TagNames.Name, $"{term}*") { AllowFuzzy = true, Boost = boostProductName, Analyzer = "whitespace" });
filterTermClause.Tags.Add(new Tag(TagNames.Name, $"*{term}*") { AllowFuzzy = true, Boost = boostProductName, Analyzer = "whitespace" });

But I still get no result

When handling searches it is both the search and the index creation that may need to get another analyzer so not the indexing is removing the : and then you not is able to find that even if you search with whitespace-analyzer.

Wildcard searches and fuzzyness can’t be combined. Fuzzyness can only be used if you search for a term without placeholder (wildcard, question-mark etc) characters.

Using * in front of word is the best thing you can do to if you want bad performance for the search. In most case that will not get any relevant hits anyway.

We can’t move past that we get bad search result if we remove * in front of the word.

What kind of search are you using in the PIM?

In the administration? There the querying with the dataservice is used.

Yes, cause there it always works with our different needs with the search.
The problem is that with cameras were using lots of 4:3 for example.

Our search now is kind of ok. All we need is that the : should work too. We don’t want to rewrite how the search works. What’s the best solution?

It does not exists a general rule that exists for all search cases. Sometimes it works with only changing the analyzer for the search, sometimes you need to add an IIndexingProviderPreProcessor that will change how the things are indexed because the indexing is also using analyzers and also the indexing analyzer may need to be changed from the standard analyzer one.

How do I change the analyzer when the index is created? Or is it enough for me just to change it in my search to use “whitespace” instead?

Cause I’ve tried to change the analyzer but when I do this I get no result of 4:3 anyway