Как предотвратить использование Sitecore Azure Search для создания поля с помощью Analyzer - PullRequest
0 голосов
/ 28 февраля 2020

мы используем пользовательский индекс в sitecore, определяющий, какие поля индексировать следующим образом:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" >
  <sitecore role:require="Standalone or ContentManagement or ContentDelivery" search:require="Azure">
    <contentSearch>
      <indexConfigurations>
        <defaultCloudIndexConfiguration type="Sitecore.ContentSearch.Azure.CloudIndexConfiguration, Sitecore.ContentSearch.Azure">
          <documentOptions type="Sitecore.ContentSearch.DocumentBuilderOptions, Sitecore.ContentSearch">
            <include hint="list:AddIncludedField">
              <CountryISOCode2>{ItemId}</CountryISOCode2>
            </include>
          </documentOptions>
        </defaultCloudIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>

Проблема в том, что существует поле CountryISOCode2, поэтому в нем есть такие записи: " it "(Италия)," no "(Норвегия), et c ... но это поле создается в AS как" анализатор ":" en.lucene ":

{
  "name": "countryisocode2_s",
  "type": "Edm.String",
  "facetable": true,
  "filterable": true,
  "key": false,
  "retrievable": true,
  "searchable": true,
  "sortable": true,
  "analyzer": "en.lucene",
  "indexAnalyzer": null,
  "searchAnalyzer": null,
  "synonymMaps": [],
  "fields": []
}

Так что это вызывает что применяется стоп-слово из Solr, поэтому, если мы ищем «IT» (следует привести Италию), AS игнорирует ключевое слово, как в файле stopwords.txt, возвращая все возможные результаты ...

...