#4303: add search function.
This commit is contained in:
14
Oqtane.Shared/Interfaces/IModuleSearch.cs
Normal file
14
Oqtane.Shared/Interfaces/IModuleSearch.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Interfaces
|
||||
{
|
||||
public interface IModuleSearch
|
||||
{
|
||||
public IList<SearchDocument> GetSearchDocuments(Module module, DateTime startTime);
|
||||
}
|
||||
}
|
20
Oqtane.Shared/Interfaces/ISearchIndexManager.cs
Normal file
20
Oqtane.Shared/Interfaces/ISearchIndexManager.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISearchIndexManager
|
||||
{
|
||||
int Priority { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
bool IsIndexEnabled(int siteId);
|
||||
|
||||
int IndexDocuments(int siteId, DateTime? startTime, Action<IList<SearchDocument>> processSearchDocuments, Action<string> handleError);
|
||||
}
|
||||
}
|
26
Oqtane.Shared/Interfaces/ISearchProvider.cs
Normal file
26
Oqtane.Shared/Interfaces/ISearchProvider.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISearchProvider
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
void SaveDocument(SearchDocument document, bool autoCommit = false);
|
||||
|
||||
void DeleteDocument(string id);
|
||||
|
||||
Task<SearchResults> SearchAsync(SearchQuery searchQuery, Func<SearchDocument, SearchQuery, bool> validateFunc);
|
||||
|
||||
bool Optimize();
|
||||
|
||||
void Commit();
|
||||
|
||||
void ResetIndex();
|
||||
}
|
||||
}
|
14
Oqtane.Shared/Interfaces/ISearchResultManager.cs
Normal file
14
Oqtane.Shared/Interfaces/ISearchResultManager.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISearchResultManager
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
bool Visible(SearchDocument searchResult, SearchQuery searchQuery);
|
||||
|
||||
string GetUrl(SearchResult searchResult, SearchQuery searchQuery);
|
||||
}
|
||||
}
|
15
Oqtane.Shared/Interfaces/ISearchService.cs
Normal file
15
Oqtane.Shared/Interfaces/ISearchService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISearchService
|
||||
{
|
||||
void IndexContent(int siteId, DateTime? startTime, Action<string> logNote, Action<string> handleError);
|
||||
|
||||
Task<SearchResults> SearchAsync(SearchQuery searchQuery);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user