Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
db092ae
allowed to inject microsoft azure search client
efabioli Jan 2, 2018
3067d5b
fixed constructor of base azure search
efabioli Jan 3, 2018
a53ca0a
Set up version 2.0
efabioli Jan 8, 2018
38cee48
Merge branch 'feature/inject-search-service-client' into Dev/2.0
efabioli Jan 8, 2018
699271b
Created IAzureSearchQuery in order not to make AzureSearchClient resp…
efabioli Jan 8, 2018
b990374
* do not need to inject ISearchServiceClient any more
efabioli Jan 8, 2018
cac53a4
made extensions for UmbracoHelper compatible with new approach of get…
efabioli Jan 8, 2018
0db086b
made azure search start up more flexible
efabioli Jan 8, 2018
38c19d7
enhanced extensioin method
efabioli Jan 8, 2018
b669a0d
nuspec file: fixed dependency + filled in release notes
efabioli Jan 8, 2018
5d98a6f
made sure that AzureSearchContext class is instantiated correctly
efabioli Jan 8, 2018
9785160
updated release notes
efabioli Jan 9, 2018
f704993
WIP - writing tests and refactoring.
darrenferguson Mar 31, 2018
3efa592
Big refactor
darrenferguson Apr 1, 2018
4de367b
Review and rationalise contributions.
darrenferguson Apr 1, 2018
6e7b39b
Add highlighting in search results
darrenferguson Apr 1, 2018
7df915b
Abandon custom config - too much hassle.
darrenferguson Apr 3, 2018
488cc88
Support for suggestion and scoring profile.
darrenferguson Apr 3, 2018
cfcac84
start to pull back in examine stuff from tom
tompipe Jan 10, 2018
b8b3fd6
Add examine searcher support
tompipe Jan 10, 2018
a019378
WIP commit toms examine
darrenferguson Apr 3, 2018
181c6d5
more examine work.
tompipe Jan 17, 2018
00c885f
Examine tests.
darrenferguson Apr 3, 2018
194266f
Working examine search criteria and test
tompipe Jan 19, 2018
aa68c5d
Allowed to set SearchMode
efabioli Aug 9, 2018
15fa66f
exposed via AzureSearchClient a method to start a new query
efabioli Aug 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Moriyama.AzureSearch.Tests/AzureSearch.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"SearchServiceName": "",
"SearchServiceAdminApiKey": "",
"IndexName": "inttest",
"IndexBatchSize": 50,
"Fields": [
{
"Name": "umbracoNaviHide",
"FieldType": 0,
"IsKey": false,
"IsSortable": false,
"IsSearchable": false,
"IsFacetable": false,
"IsFilterable": true,
"IsGridJson": false,
"ParserType": null,
"Analyzer": null
},
{
"Name": "siteTitle",
"FieldType": 1,
"IsKey": false,
"IsSortable": false,
"IsSearchable": true,
"IsFacetable": false,
"IsFilterable": true,
"IsGridJson": false,
"ParserType": null,
"Analyzer": null
},
{
"Name": "siteDescription",
"FieldType": 1,
"IsKey": false,
"IsSortable": false,
"IsSearchable": false,
"IsFacetable": false,
"IsFilterable": true,
"IsGridJson": false,
"ParserType": null,
"Analyzer": null
},
{
"Name": "tags",
"FieldType": 2,
"IsKey": false,
"IsSortable": false,
"IsSearchable": false,
"IsFacetable": true,
"IsFilterable": false,
"IsGridJson": false,
"ParserType": null,
"Analyzer": null
},
{
"Name": "content",
"FieldType": 1,
"IsKey": false,
"IsSortable": false,
"IsSearchable": true,
"IsFacetable": false,
"IsFilterable": true,
"IsGridJson": true,
"ParserType": null,
"Analyzer": null
}
],
"Analyzers": [
{
"name": "tagsAnalyzer",
"type": "#Microsoft.Azure.Search.CustomAnalyzer",
"charFilters": [ "html_strip" ],
"tokenizer": "standard"
}
],
"ScoringProfiles": [
{
"name": "geo",
"text": {
"weights": {
"hotelName": 5
}
},
"functions": [
{
"type": "distance",
"boost": 5,
"fieldName": "location",
"interpolation": "logarithmic",
"distance": {
"referencePointParameter": "currentLocation",
"boostingDistance": 10
}
}
]
}
],
"Suggesters": [
{
"name": "nameSuggest",
"searchMode": "analyzingInfixMatching",
"sourceFields": [ "Name" ]
}
]
}
130 changes: 130 additions & 0 deletions Moriyama.AzureSearch.Tests/Helper/RandomText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Moriyama.AzureSearch.Tests.Helper
{
public class RandomText
{
static Random _random = new Random();
StringBuilder _builder;
string[] _words;



public RandomText(string[] words)
{
_builder = new StringBuilder();
_words = words;
}

public DateTime RandomDateTime()
{
DateTime d = DateTime.Now.Subtract(TimeSpan.FromDays(RandomInt(0,1000)));
return d;

}

public string RandomUrl()
{
List <string> items = new List<string>();

for (int i = 0; i <= RandomInt(1, 6); i++)
{
string segment = _words[RandomInt(0, _words.Length)];
items.Add(segment);
}

return "/" + string.Join("/", items);
}

public int[] RangeList(int from, int to)
{

IList<int> items = new List<int>();

for(int i = from; i<=to; i++)
{
items.Add(i);
}

return items.ToArray();
}

public string RandomFrom(string[] items)
{
int index = RandomInt(0, items.Length);
return items[index];
}

public string RandomintList(int y, int min, int max)
{
List<string> items = new List<string>();

for (int a = 0; a <= RandomInt(1, y); a++)
{
items.Add(RandomInt(min, max).ToString());
}

return string.Join(",", items);
}

public int RandomInt(int x, int y)
{
Random random = new Random();
return random.Next(x, y);
}

public void Reset()
{
_builder = new StringBuilder();
}

public void AddContentParagraphs(int numberParagraphs, int minSentences,

int maxSentences, int minWords, int maxWords)
{

for (int i = 0; i < numberParagraphs; i++)
{
AddParagraph(_random.Next(minSentences, maxSentences + 1),
minWords, maxWords);
_builder.Append("\n\n");
}
}

void AddParagraph(int numberSentences, int minWords, int maxWords)
{
for (int i = 0; i < numberSentences; i++)
{
int count = _random.Next(minWords, maxWords + 1);
AddSentence(count);
}
}

void AddSentence(int numberWords)
{
StringBuilder b = new StringBuilder();
// Add n words together.
for (int i = 0; i < numberWords; i++) // Number of words
{
b.Append(_words[_random.Next(_words.Length)]).Append(" ");
}
string sentence = b.ToString().Trim() + ". ";
// Uppercase sentence
sentence = char.ToUpper(sentence[0]) + sentence.Substring(1);
// Add this sentence to the class
_builder.Append(sentence);
}

public string Content
{
get
{
return _builder.ToString();
}
}
}
}
Loading