Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Among other things... * Use latest C# version * Added support for bracketed field names #76 * Added field score boosting #72 (#83) * Added field score boosting #72 * Added score boosting query syntax #72 * Add .NET 8 as a target * Item score boosting (#95) * Allow characters to be escaped in query syntax #85 * Removing ImmutableCollections (#97) * Speed up field collection prior to scoring (#102) * Added support for adding custom stemmers #82 (#103) * Apply field filters while collecting results * Filter documents at navigator level #105 * Added query part weight calculations #105 Refactor query match collection primitives
- Loading branch information
1 parent
77808a4
commit 125ae87
Showing
278 changed files
with
9,725 additions
and
4,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: "Custom stemmers" | ||
linkTitle: "Custom stemmers" | ||
weight: 7 | ||
description: > | ||
You can implement a custom stemmer if the default English Porter stemmer doesn't meet your needs. | ||
--- | ||
|
||
Let's say that for some reason you needed to stem every indexed token so that it was at most 3 characters long: | ||
|
||
```csharp | ||
public class FirstThreeLettersStemmer : IStemmer | ||
{ | ||
public bool RequiresCaseInsensitivity => false; | ||
|
||
public bool RequiresAccentInsensitivity => false; | ||
|
||
public void Stem(StringBuilder builder) | ||
{ | ||
if (builder.Length > 3) | ||
{ | ||
builder.Length = 3; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
`RequiresCaseInsensitivity` and `RequiresAccentInsensitivity` are hints used by the index at creation time that force it to enable | ||
case/accent sensitivity. Case insensitivity means that any text passed to your stemmer will already be uppercase. Accent insensitivity means | ||
that accents will automatically be stripped prior to being sent to the stemmer. | ||
|
||
Once you've got your stemmer implemented, you just need to give it to the `FullTextIndexBuilder`: | ||
|
||
``` csharp | ||
var index = new FullTextIndexBuilder<int>() | ||
.WithDefaultTokenization(o => o.WithStemming(new FirstThreeLettersStemmer())) | ||
.Build(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/content/en/docs/Index construction/WithDefaultThesaurus.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
docs/content/en/docs/Index construction/WithDuplicateItemBehavior.md
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
docs/content/en/docs/Index construction/WithDuplicateKeyBehavior.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "Managing duplicate keys" | ||
linkTitle: "Managing duplicate keys" | ||
weight: 5 | ||
description: > | ||
Configure how the index should behave when indexing an item that is already present in the index. | ||
--- | ||
|
||
`FullTextIndexBuilder<TKey> WithDuplicateKeyBehavior(DuplicateKeyBehavior duplicateKeyBehavior)` | ||
|
||
* `DuplicateKeyBehavior.Replace`: **Default** The document associated to the key will first be removed from the index, then indexed | ||
* `DuplicateKeyBehavior.ThrowException`: An exception will be thrown. You can use this if you're not expecting keys to be re-indexed and want some indication that your code isn't behaving correctly. | ||
|
||
## Example usage | ||
|
||
``` csharp | ||
var index = new FullTextIndexBuilder<int>() | ||
.WithDuplicateKeyBehavior(DuplicateKeyBehavior.ThrowException) | ||
.Build(); | ||
``` |
10 changes: 5 additions & 5 deletions
10
docs/content/en/docs/Index construction/WithIndexModificationAction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.