WithQueryParser

Prescribes how the QueryParser implementation should be configured for the index.

Providing a complete IQueryParser implementation

FullTextIndexBuilder<TKey> WithQueryParser(IQueryParser queryParser)

Allows you to provide your own implementation of IQueryParser capable of parsing text into an IQuery.

To see an example of a custom IQueryParser implementation, see this blog post.

Configuring the default LIFTI QueryParser

FullTextIndexBuilder<TKey> WithQueryParser(Func<QueryParserBuilder, QueryParserBuilder> optionsBuilder)

By default LIFTI parses query text using the LIFTI query syntax. The behavior of the parser can be tweaked using this overload.

QueryParserBuilder.AssumeFuzzySearchTerms() When used, uses fuzzy matching for any parsed search terms that don’t contain wildcard operators, i.e. you don’t need to prefix search terms with ?.

QueryParserBuilder.WithQueryParserFactory(Func<QueryParserOptions, IQueryParser>) Given a QueryParserOptions, creates the implementation of IQueryParser. You can use this to provide a custom query parsing strategy.

Example usage

var index = new FullTextIndexBuilder<int>()
    .WithQueryParser(o => o.AssumeFuzzySearch())
    .Build();
Last modified February 6, 2022: Updated docs (547b19f)