Пример #1
0
        public string GetIndexName(string sitecoreIndexName, OperationalType type)
        {
            IndexProps document = GetDocument(sitecoreIndexName, type);

            if (document == null)
            {
                return(string.Empty);
            }
            return(document.ServiceName);
        }
Пример #2
0
 private IndexProps GetDocument(string name, OperationalType type)
 {
     return(DeserializeDocument(_searchServiceClient.Search($"&$filter=sitecorename eq '{name}' and indextype eq '{type.ToString().ToUpperInvariant()}'")));
 }
Пример #3
0
 public void SetIndexName(string sitecoreIndexName, OperationalType type, string serviceIndexName)
 {
     _searchServiceClient.PostDocuments(string.Format(CultureInfo.InvariantCulture, "{{\n                    \"value\": [\n                        {{\n                            \"@search.action\": \"mergeOrUpload\",\n                            \"key\": \"{0}\",\n                            \"servicename\": \"{1}\",\n                            \"indextype\": \"{2}\",\n                            \"sitecorename\": \"{3}\"\n                        }}\n                    ]\n                }}", $"{sitecoreIndexName.ToUpperInvariant()}-{type.ToString().ToUpperInvariant()}", serviceIndexName, type.ToString().ToUpperInvariant(), sitecoreIndexName));
 }