AntIndex 2.5.2
dotnet add package AntIndex --version 2.5.2
NuGet\Install-Package AntIndex -Version 2.5.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AntIndex" Version="2.5.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AntIndex" Version="2.5.2" />
<PackageReference Include="AntIndex" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AntIndex --version 2.5.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AntIndex, 2.5.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AntIndex@2.5.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AntIndex&version=2.5.2
#tool nuget:?package=AntIndex&version=2.5.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AntIndex
Linked data text search engine.
Features
- Fast text search using 2-gramm words index
- Designed to search for entities of different types (up to 250 types)
- Support for data hierarchy and relatedness
- Flexible sorting settings
- MessagePack binary serialization enabled index file saving utilities
Documentation
Normalizing and splitting
The library provides built-in tools for normalizing and splitting a name into words for searching. Use this static objects.
AntIndex.Services.Normalizing.DefaultNormalizer.Instance AntIndex.Services.Splitting.DefaultPhraseSplitter.Instance
Also, you can redefine normalization and phrases splitting on words for use in your cases. Implement: IPhraseSplitter and INormalizer
Defining entities of search
- Your search entity must implement the interface IIndexedEntity
- GetKey() - Defines an entity keys
- Use Ant.Key() for create key, entityType must be greater than 0
- GetNames() - Define the phrases by which the search will be carried out
- Use the Ant.Phrase() method and its overloads to specify names to search for and to define the name type for flexible sorting and scoring.
- If you are using the extended phrase configuration Ant.Phrase(string phrase, byte phraseType), use phraseType > 0
- GetLinks() - Identify the keys that are associated with your entity (when creating an index, the entity will be a child of each element in the Links list)
- GetKey() - Defines an entity keys
Build index
Building
- Use Ant.Build() to build Anthill index isntance, passing the normalizer and splitter instances to the method, as well as an enumeration entities for searching
- Also, you can get an instance of the builder using Ant.GetBuilder(INormalizer normalizer, IPhraseSplitter phraseSplitter, HierarchySettings? settings = null)
- Setup HierarchySettings. Declare type dependencies to containers or parents to use SearchBy and AppendChilds
- Call builder AddEntity method to add entity (multithreading is not working)
- Call Build to get Anthill instance
Save
- Use Ant.WriteIndex(AntHill index, string filePath) for saving index file
- Use Ant.ReadIndex(string filePath) for read index file
Search
*Create index searcher
Implement abstract AntSearcherBase
- Implement AntSearcherBase.Request property (array of requests to search) to configure your search request. The query options are presented below (use in the same order for proper operation)
- Search - search current type entities
- SearchBy - search current type entities in parents hierarchy (parents must be found in the Search block above)
- Select - performs forced addition of entities of the target type based on the passed ids
- AppendChilds - use to force adding entities by parent
- Override GetLinkedEntityMatchMiltipler(byte entityType, byte linkedType) for flexible scoring mathes of linked entities
- Override GetPhraseTypeMultipler(byte phraseType) for flexible scoring by phrase types
- Override OnLinkedEntityMatched(Key entityKey, Key linkedKey) to add individual sorting rules if linked entity is match
- Override OnEntityProcessed(EntityMatchesBundle entityMatchesBundle) to add individual sorting rules
- Override ResultVisionFilter(byte type, IEnumerable<EntityMatchesBundle> result) to filter the results that will be output as a result
Search
- Use AntSearcherBase method Search passing the search context
- Or use AntSearcherBase method SearchTypes passing the search context and list of target entities with their count
Optimizations
- If your entity cannot be found if the hierarchy parent is not found, be sure to set the IIndexedEntity.GetContainer method to improve performance.
- If you using overrides OnLinkedEntityMatched or OnEntityProcessed use a static AdditionalRule intances for smaller memory allocations
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- MessagePack (>= 3.1.4)
-
net8.0
- MessagePack (>= 3.1.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.