Skip to content

Commit 29ad2b0

Browse files
Merge pull request #2334 from BEXIS2/OpenSearch
searchconfig first steps
2 parents 0a1fe2f + fcfb07d commit 29ad2b0

File tree

78 files changed

+7663
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+7663
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,5 @@ svelte
282282
/_output
283283
/Console/BExIS.Web.Shell/Web.config
284284
/Console/BExIS.Web.Shell/Areas/SMM/BExIS.Modules.SMM.UI/Properties/PublishProfiles/FolderProfile.pubxml
285+
/Console/BExIS.Web.Shell/Web.config.backup
286+
/Console/BExIS.Web.Shell/Web.config.backup2

BExIS++.sln

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Microsoft Visual Studio Solution File, Format Version 12.00
23
# Visual Studio Version 17
34
VisualStudioVersion = 17.9.34723.18
@@ -234,6 +235,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SMM", "SMM", "{02EA681E-C7D
234235
EndProject
235236
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BExIS.Modules.SMM.UI", "Console\BExIS.Web.Shell\Areas\SMM\BExIS.Modules.SMM.UI\BExIS.Modules.SMM.UI.csproj", "{37402CAB-EB81-4D08-8791-8653949C0FEB}"
236237
EndProject
238+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BExIS.Ddm.Providers.OpenSearch", "Modules\DDM\BExIS.Ddm.Providers.OpenSearch\BExIS.Ddm.Providers.OpenSearch.csproj", "{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}"
239+
EndProject
237240
Global
238241
GlobalSection(SolutionConfigurationPlatforms) = preSolution
239242
Debug|Any CPU = Debug|Any CPU
@@ -1508,6 +1511,24 @@ Global
15081511
{37402CAB-EB81-4D08-8791-8653949C0FEB}.TestServerRelease|Mixed Platforms.Build.0 = TestServerRelease|Any CPU
15091512
{37402CAB-EB81-4D08-8791-8653949C0FEB}.TestServerRelease|x86.ActiveCfg = TestServerRelease|Any CPU
15101513
{37402CAB-EB81-4D08-8791-8653949C0FEB}.TestServerRelease|x86.Build.0 = TestServerRelease|Any CPU
1514+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1515+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
1516+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
1517+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
1518+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|x86.ActiveCfg = Debug|Any CPU
1519+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Debug|x86.Build.0 = Debug|Any CPU
1520+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
1521+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|Any CPU.Build.0 = Release|Any CPU
1522+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
1523+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
1524+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|x86.ActiveCfg = Release|Any CPU
1525+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.Release|x86.Build.0 = Release|Any CPU
1526+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|Any CPU.ActiveCfg = Release|Any CPU
1527+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|Any CPU.Build.0 = Release|Any CPU
1528+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|Mixed Platforms.ActiveCfg = Release|Any CPU
1529+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|Mixed Platforms.Build.0 = Release|Any CPU
1530+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|x86.ActiveCfg = Release|Any CPU
1531+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7}.TestServerRelease|x86.Build.0 = Release|Any CPU
15111532
EndGlobalSection
15121533
GlobalSection(SolutionProperties) = preSolution
15131534
HideSolutionNode = FALSE
@@ -1604,10 +1625,11 @@ Global
16041625
{9BFFFD11-03C6-47DF-9CC9-F458A9A49377} = {F3354AC7-CDA1-44E2-8E85-8DB532ED8C75}
16051626
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {692AFF14-3A57-47D8-912F-093EC8F561C4}
16061627
{37402CAB-EB81-4D08-8791-8653949C0FEB} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
1628+
{36D5D1A4-CED1-4D3C-831B-6A4B0E5320A7} = {A98E4405-1702-4F38-9EBD-AEA67D4185A6}
16071629
EndGlobalSection
16081630
GlobalSection(ExtensibilityGlobals) = postSolution
1609-
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
16101631
SolutionGuid = {9B6E4921-8EBA-487D-A098-3E473A0EAC64}
1632+
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35
16111633
EndGlobalSection
16121634
GlobalSection(SubversionScc) = preSolution
16131635
Svn-Managed = True

Console/BExIS.Web.Shell.Svelte/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/BExIS.Modules.Ddm.UI.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@
389389
<Project>{FBE3101A-791A-4EAB-9B8F-F6E071F8DBDC}</Project>
390390
<Name>BExIS.Ddm.Providers.LuceneProvider</Name>
391391
</ProjectReference>
392+
<ProjectReference Include="..\..\..\..\..\Modules\DDM\BExIS.Ddm.Providers.OpenSearch\BExIS.Ddm.Providers.OpenSearch.csproj">
393+
<Project>{36d5d1a4-ced1-4d3c-831b-6a4b0e5320a7}</Project>
394+
<Name>BExIS.Ddm.Providers.OpenSearch</Name>
395+
</ProjectReference>
392396
<ProjectReference Include="..\..\..\..\..\Modules\DIM\BExIS.Dim.Entities\BExIS.Dim.Entities.csproj">
393397
<Project>{34CAD2A2-6928-458B-B8DC-AF71D55F20CC}</Project>
394398
<Name>BExIS.Dim.Entities</Name>

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/DdmModule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public override void Install()
3636
public override void Start()
3737
{
3838
base.Start();
39-
Vaiona.IoC.IoCFactory.Container.RegisterHeirarchical(typeof(BExIS.Ddm.Api.ISearchProvider), typeof(BExIS.Ddm.Providers.LuceneProvider.SearchProvider));
39+
Vaiona.IoC.IoCFactory.Container.RegisterHeirarchical(typeof(BExIS.Ddm.Api.ISearchProvider), typeof(BExIS.Ddm.Providers.OpenSearch.SearchProvider));
40+
//Vaiona.IoC.IoCFactory.Container.RegisterHeirarchical(typeof(BExIS.Ddm.Api.ISearchProvider), typeof(BExIS.Ddm.Providers.LuceneProvider.SearchProvider));
4041
}
4142

4243
public override void Shutdown()

Console/Workspace

Submodule Workspace updated 53 files

Modules/DDM/BExIS.Ddm.Providers.LuceneProvider/Config/SearchConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ private static void Load()
124124
numericProperties.Add(fieldName.ToLower());
125125
}
126126

127+
// get all facets plus and all value in there
127128
if (fieldType.ToLower().Equals("facet_field"))
128129
{
129130
facetXmlNodeList.Add(fieldProperty);
@@ -148,21 +149,25 @@ private static void Load()
148149
{
149150
if (!hpg.Name.ToString().Equals(""))
150151
{
152+
151153
Facet ccDefault = new Facet();
152154
ccDefault.Name = hpg.Name.ToString();
153155
ccDefault.Text = hpg.Name.ToString();
154156
ccDefault.Value = hpg.Name.ToString();
155157
ccDefault.Count = (int)hpg.HitCount;
156158
if (ccDefault.Count > 0) cCount++;
157159

160+
// iterate over all Documents inside this facet
158161
foreach (var doc in hpg.Documents)
159162
{
160163
IList<IFieldable> numericFields = doc.GetFields("facet_" + fieldName);
164+
// get all values inside this Document that is link to this facet
161165
foreach (var field in numericFields)
162166
{
163167
ccDefault.Name = field.StringValue;
164168
ccDefault.Text = field.StringValue;
165169
ccDefault.Value = field.StringValue;
170+
// check if Person is already in a child
166171
if (!cDefault.Childrens.Exists(x => x.Name == ccDefault.Name)) cDefault.Childrens.Add(ccDefault);
167172
}
168173
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
11+
</dependentAssembly>
12+
<dependentAssembly>
13+
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
14+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
15+
</dependentAssembly>
16+
<dependentAssembly>
17+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
18+
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
19+
</dependentAssembly>
20+
<dependentAssembly>
21+
<assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral" />
22+
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
23+
</dependentAssembly>
24+
<dependentAssembly>
25+
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
26+
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
27+
</dependentAssembly>
28+
<dependentAssembly>
29+
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
30+
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
31+
</dependentAssembly>
32+
<dependentAssembly>
33+
<assemblyIdentity name="MimeKit" publicKeyToken="bede1c8a46c66814" culture="neutral" />
34+
<bindingRedirect oldVersion="0.0.0.0-4.8.0.0" newVersion="4.8.0.0" />
35+
</dependentAssembly>
36+
<dependentAssembly>
37+
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
38+
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
39+
</dependentAssembly>
40+
<dependentAssembly>
41+
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
42+
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
43+
</dependentAssembly>
44+
<dependentAssembly>
45+
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
46+
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
47+
</dependentAssembly>
48+
<dependentAssembly>
49+
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
50+
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
51+
</dependentAssembly>
52+
<dependentAssembly>
53+
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
54+
<bindingRedirect oldVersion="0.0.0.0-6.35.0.0" newVersion="6.35.0.0" />
55+
</dependentAssembly>
56+
<dependentAssembly>
57+
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
58+
<bindingRedirect oldVersion="0.0.0.0-6.35.0.0" newVersion="6.35.0.0" />
59+
</dependentAssembly>
60+
<dependentAssembly>
61+
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
62+
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
63+
</dependentAssembly>
64+
<dependentAssembly>
65+
<assemblyIdentity name="System.Security.Cryptography.ProtectedData" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
66+
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
67+
</dependentAssembly>
68+
<dependentAssembly>
69+
<assemblyIdentity name="System.Security.AccessControl" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
70+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
71+
</dependentAssembly>
72+
<dependentAssembly>
73+
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
74+
<bindingRedirect oldVersion="0.0.0.0-7.0.0.2" newVersion="7.0.0.2" />
75+
</dependentAssembly>
76+
<dependentAssembly>
77+
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
78+
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
79+
</dependentAssembly>
80+
<dependentAssembly>
81+
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
82+
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
83+
</dependentAssembly>
84+
<dependentAssembly>
85+
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
86+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
87+
</dependentAssembly>
88+
<dependentAssembly>
89+
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
90+
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
91+
</dependentAssembly>
92+
</assemblyBinding>
93+
</runtime>
94+
</configuration>
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using OpenSearch.Client;
7+
8+
namespace BExIS.Ddm.Providers.OpenSearch
9+
{
10+
public class AutoCompleteDocument
11+
{
12+
public string Id { get; set; }
13+
public List<CompletionField> Suggest { get; set; } = new List<CompletionField>();
14+
public CompletionField All { get; set; } = new CompletionField();
15+
16+
private List<string> _all = new List<string>();
17+
18+
public AutoCompleteDocument(string id)
19+
{
20+
Id = id ?? throw new ArgumentNullException(nameof(id));
21+
}
22+
23+
/// <summary>
24+
/// Adds single <see cref="OpenSearch.Client.CompletionField"/> to document
25+
/// </summary>
26+
/// <param name="field"></param>
27+
public void AddCompletionField(CompletionField field) => Suggest.Add(field);
28+
29+
/// <summary>
30+
/// Adds single input with context type "category"
31+
/// </summary>
32+
/// <param name="input"></param>
33+
/// <param name="contextValue"></param>
34+
public void AddCategory(string input, string contextValue)
35+
{
36+
var compField = new CompletionField
37+
{
38+
Input = new[] { input },
39+
Contexts = new Dictionary<string, IEnumerable<string>> { { "category", new[] { contextValue } } }
40+
};
41+
Suggest.Add(compField);
42+
_all.Add(input);
43+
}
44+
45+
public void WithAllCompletion()
46+
{
47+
All = new CompletionField
48+
{
49+
Input = _all.ToArray(),
50+
};
51+
}
52+
53+
54+
/// <summary>
55+
/// Adds single input with context type "location"
56+
/// </summary>
57+
/// <param name="input"></param>
58+
/// <param name="latitude"></param>
59+
/// <param name="longitude"></param>
60+
public void AddLocation(string input, double latitude, double longitude)
61+
{
62+
var compField = new CompletionField
63+
{
64+
Input = new[] { input },
65+
Contexts = new Dictionary<string, IEnumerable<string>>
66+
{
67+
{ "location", new[] { $"{latitude}, {longitude}" } }
68+
}
69+
};
70+
Suggest.Add(compField);
71+
}
72+
73+
74+
/// <summary>
75+
/// Single Input without context
76+
/// </summary>
77+
/// <param name="inputs"></param>
78+
public void AddSuggestion(params string[] inputs)
79+
{
80+
var compField = new CompletionField
81+
{
82+
Input = inputs
83+
};
84+
Suggest.Add(compField);
85+
}
86+
87+
/// <summary>
88+
/// Single input with single context
89+
/// </summary>
90+
/// <param name="input"></param>
91+
/// <param name="contextKey"></param>
92+
/// <param name="contextValue"></param>
93+
public void AddSuggestion(string input, string contextKey, string contextValue)
94+
{
95+
var compField = new CompletionField
96+
{
97+
Input = new[] { input },
98+
Contexts = new Dictionary<string, IEnumerable<string>> { { contextKey, new[] { contextValue } } }
99+
};
100+
Suggest.Add(compField);
101+
}
102+
103+
/// <summary>
104+
/// Multi input with multi contexts
105+
/// </summary>
106+
/// <param name="inputs"></param>
107+
/// <param name="contextKey"></param>
108+
/// <param name="contextValues"></param>
109+
public void AddSuggestion(IEnumerable<string> inputs, string contextKey, IEnumerable<string> contextValues)
110+
{
111+
var compField = new CompletionField
112+
{
113+
Input = inputs.ToArray(),
114+
Contexts = new Dictionary<string, IEnumerable<string>> { { contextKey, contextValues } }
115+
};
116+
Suggest.Add(compField);
117+
}
118+
119+
}
120+
}

0 commit comments

Comments
 (0)