Skip to content

Commit e240a87

Browse files
committed
Implement wildcard analyzer
Fixes DE-750.
1 parent 0edc771 commit e240a87

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ This driver uses semantic versioning:
3434

3535
- Added support for `multi_delimiter` analyzer type (DE-753)
3636

37+
- Added support for `wildcard` analyzer type (DE-750)
38+
3739
## [8.7.0] - 2024-02-14
3840

3941
### Changed

src/analyzer.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type CreateAnalyzerOptions =
4646
| CreateMinHashAnalyzerOptions
4747
| CreateClassificationAnalyzerOptions
4848
| CreateNearestNeighborsAnalyzerOptions
49+
| CreateWildcardAnalyzerOptions
4950
| CreateGeoJsonAnalyzerOptions
5051
| CreateGeoPointAnalyzerOptions
5152
| CreateGeoS2AnalyzerOptions;
@@ -516,6 +517,33 @@ export type CreateNearestNeighborsAnalyzerOptions = {
516517
};
517518
};
518519

520+
/**
521+
* Options for creating a Wildcard Analyzer.
522+
*/
523+
export type CreateWildcardAnalyzerOptions = {
524+
/**
525+
* Type of the Analyzer.
526+
*/
527+
type: "wildcard";
528+
/**
529+
* Features to enable for this Analyzer.
530+
*/
531+
features?: AnalyzerFeature[];
532+
/**
533+
* Additional properties for the Analyzer.
534+
*/
535+
properties: {
536+
/**
537+
* N-gram length. Must be a positive integer greater than or equal to 2.
538+
*/
539+
ngramSize: string;
540+
/**
541+
* An Analyzer definition-like object with `type` and `properties` attributes.
542+
*/
543+
analyzer?: Omit<CreateAnalyzerOptions, "features">;
544+
};
545+
};
546+
519547
/**
520548
* Options for creating a GeoJSON Analyzer
521549
*/
@@ -667,6 +695,7 @@ export type AnalyzerDescription =
667695
| MinHashAnalyzerDescription
668696
| ClassificationAnalyzerDescription
669697
| NearestNeighborsAnalyzerDescription
698+
| WildcardAnalyzerDescription
670699
| GeoJsonAnalyzerDescription
671700
| GeoPointAnalyzerDescription
672701
| GeoS2AnalyzerDescription;
@@ -834,6 +863,17 @@ export type NearestNeighborsAnalyzerDescription = GenericAnalyzerDescription & {
834863
};
835864
};
836865

866+
/**
867+
* An object describing a Wildcard Analyzer
868+
*/
869+
export type WildcardAnalyzerDescription = GenericAnalyzerDescription & {
870+
type: "wildcard";
871+
properties: {
872+
ngramSize: number;
873+
analyzer?: Omit<AnalyzerDescription, "name" | "features">;
874+
};
875+
};
876+
837877
/**
838878
* An object describing a GeoJSON Analyzer
839879
*/

0 commit comments

Comments
 (0)