This commit is contained in:
@@ -35,6 +35,9 @@ IMMEDIATE ITEMS:
|
|||||||
- Add tests for searching and routes, test all variants of search including rights related stuff
|
- Add tests for searching and routes, test all variants of search including rights related stuff
|
||||||
- Update all the seeder code to add search indexing so can properly test huge search datasets
|
- Update all the seeder code to add search indexing so can properly test huge search datasets
|
||||||
- Need to find a way to add random text to Notes fields that varies but has some overlap ideally
|
- Need to find a way to add random text to Notes fields that varies but has some overlap ideally
|
||||||
|
- bugbug: why is the single letter a being indexed? Missing shortness filter??
|
||||||
|
- bugbug: in searchkey an item will appear twice if the keywords appear in both the name and the text
|
||||||
|
- Update all the other routes to include search indexing (attachments, tags etc, anything with text in it)
|
||||||
|
|
||||||
- EventLogProcessor.AddEntry: CHANGE this to save the context itself and then change all callers to handle that (remove save)
|
- EventLogProcessor.AddEntry: CHANGE this to save the context itself and then change all callers to handle that (remove save)
|
||||||
- I originally didn't have the save in there because I thought subsequent code might all share in the single context save,
|
- I originally didn't have the save in there because I thought subsequent code might all share in the single context save,
|
||||||
|
|||||||
@@ -173,8 +173,10 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//SEARCH SEARCHKEY FOR MATCHING WORDS AND OPTIONALLY TYPE AND INNAME
|
//SEARCH SEARCHKEY FOR MATCHING WORDS AND OPTIONALLY TYPE AND INNAME
|
||||||
|
|
||||||
|
var TestRawMatches = await ct.SearchKey.Where(x => DictionaryMatches.Contains(x.WordId)).ToListAsync();
|
||||||
|
|
||||||
//Build search query based on searchParameters
|
//Build search query based on searchParameters
|
||||||
var q = ct.SearchKey.Distinct().Where(m => DictionaryMatches.Contains(m.Id));
|
var q = ct.SearchKey.Distinct().Where(x => DictionaryMatches.Contains(x.WordId));
|
||||||
|
|
||||||
//In name?
|
//In name?
|
||||||
if (searchParameters.NameOnly)
|
if (searchParameters.NameOnly)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace raven_integration
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async void PhraseOnlySearchShouldWork()
|
public async void PhraseOnlySearchShouldWork()
|
||||||
{
|
{
|
||||||
|
const string TEST_SEARCH_PHRASE = "simple dogs";
|
||||||
|
|
||||||
//CREATE A WIDGET
|
//CREATE A WIDGET
|
||||||
dynamic D = new JObject();
|
dynamic D = new JObject();
|
||||||
@@ -32,8 +33,21 @@ namespace raven_integration
|
|||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
long FirstWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
long FirstWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||||
|
|
||||||
|
//CREATE A SECOND WIDGET
|
||||||
D = new JObject();
|
D = new JObject();
|
||||||
D.name = Util.Uniquify("Search Simple SECOND Test WIDGET");
|
D.name = Util.Uniquify("Search simple as in dogs SECOND Test WIDGET");
|
||||||
|
D.dollarAmount = 1.11m;
|
||||||
|
D.active = true;
|
||||||
|
D.roles = 0;
|
||||||
|
D.notes = "This Widget should be returned in the search as it contains both keywords in the name";
|
||||||
|
|
||||||
|
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
long SecondWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||||
|
|
||||||
|
//CREATE A THIRD WIDGET
|
||||||
|
D = new JObject();
|
||||||
|
D.name = Util.Uniquify("Search Simple THIRD Test WIDGET");
|
||||||
D.dollarAmount = 1.11m;
|
D.dollarAmount = 1.11m;
|
||||||
D.active = true;
|
D.active = true;
|
||||||
D.roles = 0;
|
D.roles = 0;
|
||||||
@@ -41,11 +55,12 @@ namespace raven_integration
|
|||||||
|
|
||||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
long SecondWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
long ThirdWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||||
|
|
||||||
//Now see if can find that widget with a phrase search
|
//Now see if can find that widget with a phrase search
|
||||||
dynamic SearchParameters = new JObject();
|
dynamic SearchParameters = new JObject();
|
||||||
SearchParameters.phrase = "simple dogs";
|
|
||||||
|
SearchParameters.phrase = TEST_SEARCH_PHRASE;
|
||||||
SearchParameters.nameOnly = false;
|
SearchParameters.nameOnly = false;
|
||||||
SearchParameters.typeOnly = 0;//no type
|
SearchParameters.typeOnly = 0;//no type
|
||||||
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||||
|
|||||||
Reference in New Issue
Block a user