Make Examine API more REST-ish (#13198)

* Make Examine API more REST-ish

* Undo bad renaming

* Move search endpoint under "searchers" route

* Update schema to match new API definition

* Update OpenAPI schema after merge

* Remove "examine" prefixes and change API route from "examine" to "search"

* Update OpenAPI json schema
This commit is contained in:
Kenn Jacobsen
2022-10-17 17:15:06 +02:00
committed by GitHub
parent e006f7cd7d
commit 000324aaba
18 changed files with 487 additions and 486 deletions

View File

@@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiController]
[BackOfficeRoute("api/v{version:apiVersion}/examineManagement")]
[OpenApiTag("ExamineManagement")]
public class ExamineManagementControllerBase : ManagementApiControllerBase
{
}

View File

@@ -1,42 +0,0 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class IndexesExamineManagementController : ExamineManagementControllerBase
{
private readonly IExamineManager _examineManager;
private readonly IExamineIndexViewModelFactory _examineIndexViewModelFactory;
public IndexesExamineManagementController(
IExamineManager examineManager,
IExamineIndexViewModelFactory examineIndexViewModelFactory)
{
_examineManager = examineManager;
_examineIndexViewModelFactory = examineIndexViewModelFactory;
}
/// <summary>
/// Get the details for indexers
/// </summary>
/// <returns></returns>
[HttpGet("indexes")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<ExamineIndexViewModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<ExamineIndexViewModel>> Indexes(int skip, int take)
{
ExamineIndexViewModel[] indexes = _examineManager.Indexes
.Select(_examineIndexViewModelFactory.Create)
.OrderBy(examineIndexModel => examineIndexModel.Name?.TrimEnd("Indexer")).ToArray();
var viewModel = new PagedViewModel<ExamineIndexViewModel> { Items = indexes.Skip(skip).Take(take), Total = indexes.Length };
return viewModel;
}
}

View File

@@ -2,21 +2,21 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiVersion("1.0")]
public class IndexExamineManagementController : ExamineManagementControllerBase
public class IndexDetailsSearchController : SearchControllerBase
{
private readonly IExamineIndexViewModelFactory _examineIndexViewModelFactory;
private readonly IIndexViewModelFactory _indexViewModelFactory;
private readonly IExamineManager _examineManager;
public IndexExamineManagementController(
IExamineIndexViewModelFactory examineIndexViewModelFactory,
public IndexDetailsSearchController(
IIndexViewModelFactory indexViewModelFactory,
IExamineManager examineManager)
{
_examineIndexViewModelFactory = examineIndexViewModelFactory;
_indexViewModelFactory = indexViewModelFactory;
_examineManager = examineManager;
}
@@ -29,15 +29,15 @@ public class IndexExamineManagementController : ExamineManagementControllerBase
/// This is kind of rudimentary since there's no way we can know that the index has rebuilt, we
/// have a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache
/// </remarks>
[HttpGet("index")]
[HttpGet("index/{indexName}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ExamineIndexViewModel), StatusCodes.Status200OK)]
public async Task<ActionResult<ExamineIndexViewModel?>> Index(string indexName)
[ProducesResponseType(typeof(IndexViewModel), StatusCodes.Status200OK)]
public async Task<ActionResult<IndexViewModel?>> Index(string indexName)
{
if (_examineManager.TryGetIndex(indexName, out IIndex? index))
{
return await Task.FromResult(_examineIndexViewModelFactory.Create(index!));
return await Task.FromResult(_indexViewModelFactory.Create(index!));
}
var invalidModelProblem = new ProblemDetails

View File

@@ -0,0 +1,41 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiVersion("1.0")]
public class IndexListSearchController : SearchControllerBase
{
private readonly IExamineManager _examineManager;
private readonly IIndexViewModelFactory _indexViewModelFactory;
public IndexListSearchController(
IExamineManager examineManager,
IIndexViewModelFactory indexViewModelFactory)
{
_examineManager = examineManager;
_indexViewModelFactory = indexViewModelFactory;
}
/// <summary>
/// Get the details for indexers
/// </summary>
/// <returns></returns>
[HttpGet("index")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IndexViewModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<IndexViewModel>> Indexes(int skip, int take)
{
IndexViewModel[] indexes = _examineManager.Indexes
.Select(_indexViewModelFactory.Create)
.OrderBy(indexModel => indexModel.Name.TrimEnd("Indexer")).ToArray();
var viewModel = new PagedViewModel<IndexViewModel> { Items = indexes.Skip(skip).Take(take), Total = indexes.Length };
return viewModel;
}
}

View File

@@ -5,17 +5,17 @@ using Microsoft.Extensions.Logging;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.New.Cms.Infrastructure.Services;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiVersion("1.0")]
public class RebuildExamineManagementController : ExamineManagementControllerBase
public class IndexRebuildSearchController : SearchControllerBase
{
private readonly ILogger<RebuildExamineManagementController> _logger;
private readonly ILogger<IndexRebuildSearchController> _logger;
private readonly IIndexingRebuilderService _indexingRebuilderService;
private readonly IExamineManager _examineManager;
public RebuildExamineManagementController(
ILogger<RebuildExamineManagementController> logger,
public IndexRebuildSearchController(
ILogger<IndexRebuildSearchController> logger,
IIndexingRebuilderService indexingRebuilderService,
IExamineManager examineManager)
{
@@ -29,7 +29,7 @@ public class RebuildExamineManagementController : ExamineManagementControllerBas
/// </summary>
/// <param name="indexName"></param>
/// <returns></returns>
[HttpPost("rebuild")]
[HttpPost("index/{indexName}/rebuild")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(OkResult), StatusCodes.Status200OK)]

View File

@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiController]
[VersionedApiBackOfficeRoute("search")]
[OpenApiTag("Search")]
public class SearchControllerBase : ManagementApiControllerBase
{
}

View File

@@ -1,25 +1,24 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiVersion("1.0")]
public class SearchersExamineManagementController : ExamineManagementControllerBase
public class SearcherListSearchController : SearchControllerBase
{
private readonly IExamineManager _examineManager;
public SearchersExamineManagementController(IExamineManager examineManager) => _examineManager = examineManager;
public SearcherListSearchController(IExamineManager examineManager) => _examineManager = examineManager;
/// <summary>
/// Get the details for searchers
/// </summary>
/// <returns></returns>
[HttpGet("searchers")]
[HttpGet("searcher")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<SearcherViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<SearcherViewModel>>> Searchers(int skip, int take)

View File

@@ -4,20 +4,20 @@ using Lucene.Net.QueryParsers.Classic;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Services;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Controllers.Search;
[ApiVersion("1.0")]
public class SearchExamineManagementController : ExamineManagementControllerBase
public class SearcherSearchSearchController : SearchControllerBase
{
private readonly IExamineManagerService _examineManagerService;
public SearchExamineManagementController(IExamineManagerService examineManagerService) => _examineManagerService = examineManagerService;
public SearcherSearchSearchController(IExamineManagerService examineManagerService) => _examineManagerService = examineManagerService;
[HttpGet("search")]
[HttpGet("searcher/{searcherName}/search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<PagedViewModel<SearchResultViewModel>>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]

View File

@@ -7,9 +7,9 @@ using Umbraco.New.Cms.Infrastructure.Services;
namespace Umbraco.Cms.ManagementApi.DependencyInjection;
public static class ExamineManagementBuilderExtensions
public static class SearchManagementBuilderExtensions
{
internal static IUmbracoBuilder AddExamineManagement(this IUmbracoBuilder builder)
internal static IUmbracoBuilder AddSearchManagement(this IUmbracoBuilder builder)
{
// Add examine service
builder.Services.AddTransient<IExamineManagerService, ExamineManagerService>();
@@ -18,7 +18,7 @@ public static class ExamineManagementBuilderExtensions
// Add factories
builder.Services.AddTransient<IIndexDiagnosticsFactory, IndexDiagnosticsFactory>();
builder.Services.AddTransient<IIndexRebuilder, ExamineIndexRebuilder>();
builder.Services.AddTransient<IExamineIndexViewModelFactory, ExamineIndexViewModelFactory>();
builder.Services.AddTransient<IIndexViewModelFactory, IndexViewModelFactory>();
return builder;
}
}

View File

@@ -1,9 +0,0 @@
using Examine;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Factories;
public interface IExamineIndexViewModelFactory
{
ExamineIndexViewModel Create(IIndex index);
}

View File

@@ -0,0 +1,9 @@
using Examine;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
namespace Umbraco.Cms.ManagementApi.Factories;
public interface IIndexViewModelFactory
{
IndexViewModel Create(IIndex index);
}

View File

@@ -1,29 +1,29 @@
using Examine;
using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.New.Cms.Infrastructure.Services;
namespace Umbraco.Cms.ManagementApi.Factories;
public class ExamineIndexViewModelFactory : IExamineIndexViewModelFactory
public class IndexViewModelFactory : IIndexViewModelFactory
{
private readonly IIndexDiagnosticsFactory _indexDiagnosticsFactory;
private readonly IIndexRebuilder _indexRebuilder;
private readonly IIndexingRebuilderService _indexingRebuilderService;
public ExamineIndexViewModelFactory(IIndexDiagnosticsFactory indexDiagnosticsFactory, IIndexRebuilder indexRebuilder, IIndexingRebuilderService indexingRebuilderService)
public IndexViewModelFactory(IIndexDiagnosticsFactory indexDiagnosticsFactory, IIndexRebuilder indexRebuilder, IIndexingRebuilderService indexingRebuilderService)
{
_indexDiagnosticsFactory = indexDiagnosticsFactory;
_indexRebuilder = indexRebuilder;
_indexingRebuilderService = indexingRebuilderService;
}
public ExamineIndexViewModel Create(IIndex index)
public IndexViewModel Create(IIndex index)
{
if (_indexingRebuilderService.IsRebuilding(index.Name))
{
return new ExamineIndexViewModel
return new IndexViewModel
{
Name = index.Name,
HealthStatus = "Rebuilding",
@@ -37,7 +37,7 @@ public class ExamineIndexViewModelFactory : IExamineIndexViewModelFactory
Attempt<string?> isHealthy = indexDiag.IsHealthy();
var indexerModel = new ExamineIndexViewModel
var indexerModel = new IndexViewModel
{
Name = index.Name,
HealthStatus = isHealthy.Success ? isHealthy.Result ?? "Healthy" : isHealthy.Result ?? "Unhealthy",

View File

@@ -39,7 +39,7 @@ public class ManagementApiComposer : IComposer
builder
.AddNewInstaller()
.AddUpgrader()
.AddExamineManagement()
.AddSearchManagement()
.AddFactories()
.AddTrees()
.AddFactories()

View File

@@ -723,6 +723,245 @@
}
}
},
"/umbraco/api/v1/search/index/{indexName}": {
"get": {
"tags": [
"Search"
],
"summary": "Check if the index has been rebuilt",
"description": "This is kind of rudimentary since there's no way we can know that the index has rebuilt, we\nhave a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache",
"operationId": "IndexDetailsSearch_Index",
"parameters": [
{
"name": "indexName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
}
],
"responses": {
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IndexViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/search/index": {
"get": {
"tags": [
"Search"
],
"summary": "Get the details for indexers",
"operationId": "IndexListSearch_Indexes",
"parameters": [
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfIndexViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/search/index/{indexName}/rebuild": {
"post": {
"tags": [
"Search"
],
"summary": "Rebuilds the index",
"operationId": "IndexRebuildSearch_Rebuild",
"parameters": [
{
"name": "indexName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
}
],
"responses": {
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/umbraco/api/v1/search/searcher": {
"get": {
"tags": [
"Search"
],
"summary": "Get the details for searchers",
"operationId": "SearcherListSearch_Searchers",
"parameters": [
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfSearcherViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/search/searcher/{searcherName}/search": {
"get": {
"tags": [
"Search"
],
"operationId": "SearcherSearchSearch_GetSearchResults",
"parameters": [
{
"name": "searcherName",
"in": "path",
"required": true,
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
},
{
"name": "query",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 2
},
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 3
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 4
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfPagedViewModelOfSearchResultViewModel"
}
}
}
},
"404": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/umbraco/api/v1/script/tree/children": {
"get": {
"tags": [
@@ -2330,242 +2569,6 @@
}
}
},
"/umbraco/api/v1/examineManagement/indexes": {
"get": {
"tags": [
"ExamineManagement"
],
"summary": "Get the details for indexers",
"operationId": "IndexesExamineManagement_Indexes",
"parameters": [
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfExamineIndexViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/examineManagement/index": {
"get": {
"tags": [
"ExamineManagement"
],
"summary": "Check if the index has been rebuilt",
"description": "This is kind of rudimentary since there's no way we can know that the index has rebuilt, we\nhave a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache",
"operationId": "IndexExamineManagement_Index",
"parameters": [
{
"name": "indexName",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
}
],
"responses": {
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExamineIndexViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/examineManagement/rebuild": {
"post": {
"tags": [
"ExamineManagement"
],
"summary": "Rebuilds the index",
"operationId": "RebuildExamineManagement_Rebuild",
"parameters": [
{
"name": "indexName",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
}
],
"responses": {
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/umbraco/api/v1/examineManagement/searchers": {
"get": {
"tags": [
"ExamineManagement"
],
"summary": "Get the details for searchers",
"operationId": "SearchersExamineManagement_Searchers",
"parameters": [
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 1
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 2
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfSearcherViewModel"
}
}
}
}
}
}
},
"/umbraco/api/v1/examineManagement/search": {
"get": {
"tags": [
"ExamineManagement"
],
"operationId": "SearchExamineManagement_GetSearchResults",
"parameters": [
{
"name": "searcherName",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
},
{
"name": "query",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 2
},
{
"name": "skip",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 3
},
{
"name": "take",
"in": "query",
"schema": {
"type": "integer",
"format": "int32"
},
"x-position": 4
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PagedViewModelOfPagedViewModelOfSearchResultViewModel"
}
}
}
},
"404": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/umbraco/api/v1/document/tree/children": {
"get": {
"tags": [
@@ -4144,6 +4147,147 @@
}
}
},
"IndexViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"healthStatus": {
"type": "string",
"nullable": true
},
"isHealthy": {
"type": "boolean"
},
"canRebuild": {
"type": "boolean"
},
"searcherName": {
"type": "string"
},
"documentCount": {
"type": "integer",
"format": "int64"
},
"fieldCount": {
"type": "integer",
"format": "int32"
}
}
},
"PagedViewModelOfIndexViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexViewModel"
}
}
}
},
"PagedViewModelOfSearcherViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearcherViewModel"
}
}
}
},
"SearcherViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
}
}
},
"PagedViewModelOfPagedViewModelOfSearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PagedViewModelOfSearchResultViewModel"
}
}
}
},
"PagedViewModelOfSearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchResultViewModel"
}
}
}
},
"SearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"score": {
"type": "number",
"format": "float"
},
"fieldCount": {
"type": "integer",
"format": "int32"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FieldViewModel"
}
}
}
},
"FieldViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"PagedViewModelOfRelationViewModel": {
"type": "object",
"additionalProperties": false,
@@ -4621,147 +4765,6 @@
}
}
},
"PagedViewModelOfExamineIndexViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExamineIndexViewModel"
}
}
}
},
"ExamineIndexViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"healthStatus": {
"type": "string",
"nullable": true
},
"isHealthy": {
"type": "boolean"
},
"canRebuild": {
"type": "boolean"
},
"searcherName": {
"type": "string"
},
"documentCount": {
"type": "integer",
"format": "int64"
},
"fieldCount": {
"type": "integer",
"format": "int32"
}
}
},
"PagedViewModelOfSearcherViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearcherViewModel"
}
}
}
},
"SearcherViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
}
}
},
"PagedViewModelOfPagedViewModelOfSearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PagedViewModelOfSearchResultViewModel"
}
}
}
},
"PagedViewModelOfSearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"total": {
"type": "integer",
"format": "int64"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchResultViewModel"
}
}
}
},
"SearchResultViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"score": {
"type": "number",
"format": "float"
},
"fieldCount": {
"type": "integer",
"format": "int32"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FieldViewModel"
}
}
}
},
"FieldViewModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"PagedViewModelOfDocumentTreeItemViewModel": {
"type": "object",
"additionalProperties": false,
@@ -5284,9 +5287,6 @@
{
"name": "DocumentType"
},
{
"name": "ExamineManagement"
},
{
"name": "Help"
},
@@ -5329,6 +5329,9 @@
{
"name": "Script"
},
{
"name": "Search"
},
{
"name": "Server"
},

View File

@@ -1,4 +1,4 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
public class FieldViewModel
{

View File

@@ -1,6 +1,6 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
public class ExamineIndexViewModel
public class IndexViewModel
{
public string Name { get; init; } = null!;

View File

@@ -1,4 +1,4 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
public class SearchResultViewModel
{

View File

@@ -1,4 +1,4 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
public class SearcherViewModel
{