marengohue / private-eye

Source Generators and Query Builders for interacting with Azure Search in a strongly typed manner
0 stars 0 forks source link

Query Builder Source Generation #1

Open marengohue opened 1 year ago

marengohue commented 1 year ago

Stage 1 of building the lucene query is to analyze the underlying search model and generate an appropriate query builder definition based on properties and their type annotations.

For now we support only primitive types - boolean, int, string and floating point numbers.

marengohue commented 1 year ago

Certain operations are only allowed for certain underlying types and annotation combinations:

marengohue commented 1 year ago

Fields that are marked as simple fields within the index, but are not filterable, should not be valid for regular and referential equality comparisons and should not appear in the SearchQueryBuilder, when trying to build-up LINQ based queries.

Fields that are marked as searchable but not as filterable, should appear in the query builder for the purposes of search, but not for the purposes of filtering. Filtering and searching should be done in separate sections of the query builder. Example:

_searchService.Query()
    .Search(it => it.FullTextField.Matches("woah*") /* Only full text queries are allowed */)
    .Where(it => /* Only filtering queries are allowed */)
    .ToArrayAsync()