Operaterrors as a text
iduducohen opened this issue · 3 comments
iduducohen commented
Is it possible to use operators or brackets as text?
For ex : search for test &
or test (
mikegoatly commented
Hi @iduducohen, At the moment the only way to do this is to manually construct the query yourself:
// First normalize the search text
var normalizedSearchText = index.DefaultTokenizer.Normalize("test (");
// Construct a query with a single query part
var query = new Query(new ExactWordQueryPart(normalizedSearchText));
// Execute the query
var results = index.Search(query);
I'm tracking issue #85 that will allow you to escape these characters.
iduducohen commented
Thank you very much for the quick reply, I will look into the matter.
In addition, is it possible to perform NOT operations?
בתאריך יום ב׳, 18 בדצמ׳ 2023 ב-7:54 מאת Mike Goatly <
***@***.***>:
… Hi @iduducohen <https://github.com/iduducohen>, At the moment the only
way to do this is to manually construct the query yourself:
// First normalize the search textvar normalizedSearchText = index.DefaultTokenizer.Normalize("test (");
// Construct a query with a single query partvar query = new Query(new ExactWordQueryPart(normalizedSearchText));
// Execute the queryvar results = index.Search(query);
I'm tracking issue #85 <#85>
that will allow you to escape these characters.
—
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOQBI4MR5MI2ULMG6TTQI3YJ7LBRAVCNFSM6AAAAABAYTNVQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGYYDEMZWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
mikegoatly commented
No, not at the moment - that's a good feature request though. I'll create an issue to track that 😊.