3

I am trying to swap lucene with solr in our project (I use this cool guide How to switch Lucene to Solr) But I faced an issue. All except these two fields work fine.

Part of Lucene's config.

  <field fieldName="my_project_name" storageType="YES" indexType="TOKENIZED" vectorType="WITH_POSITIONS_OFFSETS" boost="1f" emptyString="_EMPTY_" nullValue="_NULL_" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
          <Analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider"/>
  </field>

  <field fieldName="my_project_type_name" storageType="YES" indexType="TOKENIZED" vectorType="WITH_POSITIONS_OFFSETS" boost="1f" emptyString="_EMPTY_" nullValue="_NULL_" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <Analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider"/>
  </field>

Part of Solr Config

<field fieldName="my_project_type_name" termVectors="true"   termPositions="true" termOffsets="true">ComputedFields.ProjectTypeNameField, Business</field>
<field fieldName="my_project_name" termVectors="true" termPositions="true" termOffsets="true">ComputedFields.ProjectNameField, Business</field>

According to solr docs I have to add relevant handler https://lucene.apache.org/solr/guide/6_6/the-term-vector-component.html - it doesn't work. Also I have tried use PostingsHighlighter with this storeOffsetWithPOsitions - the same result.

The answer is - is there any chance that sitecore support this solr feature? If so what I did in the wrong way? Can it be implemented in the other way?

1 Answer 1

1

As I see, you skipped some additional configuration.

Should be:

<field fieldName="my_project_type_name" termVectors="true" stored="yes" indexType="untokenized" returnType="string"   termPositions="true" termOffsets="true">ComputedFields.ProjectTypeNameField, Business</field>
<field fieldName="my_project_name" termVectors="true" stored="yes" indexType="untokenized" returnType="string" termPositions="true" termOffsets="true">ComputedFields.ProjectNameField, Business</field>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.