-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Including new features; free text search support and bulk delete in m…
…ongo repository. Also creating text indexes on application start if it doesn't exist already. And some aesthetic changes in the web project. Roadmap for the coming days - I'll overhaul the ElasticSearch repository as there are many new features and breaking changes in the version 1.0.
- Loading branch information
1 parent
05d40cd
commit 8e8a762
Showing
14 changed files
with
255 additions
and
51 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
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,28 @@ | ||
using Matrix.Core.FrameworkCore; | ||
using Matrix.Entities.MongoEntities; | ||
using MongoDB.Driver.Builders; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Matrix.DAL.MongoIndexSettings | ||
{ | ||
/// <summary> | ||
/// call this setting of indexes only once during the lifetime of the app. Though better approach is to create indexes directly in mongo shell. | ||
/// </summary> | ||
public class MXMongoIndexes : MXMongoRepository | ||
{ | ||
public void SetTextIndexOnBookCollection() | ||
{ | ||
var collection = dbContext.GetCollection<Book>("Book"); | ||
|
||
if (!collection.IndexExistsByName("book_text")) | ||
{ | ||
collection.CreateIndex(IndexKeys.Text("nm", "au.nm", "ct.nm"), IndexOptions.SetName("book_text").SetWeight("nm", 4).SetWeight("au.nm", 3)); | ||
} | ||
} | ||
|
||
}//End of class | ||
} |
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
Oops, something went wrong.