How to search for square brackets and underscores? #125
-
I'm struggling to find a working query for the expression Am I missing something, is this a bug or a query DSL corner case that needs special escaping? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @h0lg - always nice to hear from you! TL;DR:Try setting By default LIFTI will treat some characters as "split" characters: public virtual bool IsSplitCharacter(char character)
{
return
// Split when the character is well known as a Unicode separator or control character
char.IsSeparator(character) || char.IsControl(character) || (
(
// Split if we are splitting on punctuation and the character is a punctuation character
(this.Options.SplitOnPunctuation == true && char.IsPunctuation(character)) ||
// Or the character is in the list of additional split characters
this.additionalSplitChars.Contains(character)
)
// Unless the character is an ignored characters
&& this.ignoreChars.Contains(character) == false
);
} In your expression:
So depending on the configuration of your index, it's possible that none of that text will be indexed as they will all be considered split characters. During query tokenization, search terms are also fed through the index's tokenizer in order to split text appropriately. In your case, the query tokenizer is complaining that although you gave it some text to search for, once everything was split up, no search terms were found. So if you need to index and search on puncuation characters like I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Hey @mikegoatly :) Thank you once more for your quick and competent support! I've updated my index tokenizer config (for YouTube subtitles) with
|
Beta Was this translation helpful? Give feedback.
Hi @h0lg - always nice to hear from you!
TL;DR:
Try setting
SplitOnPunctuation
tofalse
.By default LIFTI will treat some characters as "split" characters: