mikegoatly/lifti

Operaterrors as a text

iduducohen opened this issue · 3 comments

Is it possible to use operators or brackets as text?
For ex : search for test &
or test (

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.

No, not at the moment - that's a good feature request though. I'll create an issue to track that 😊.