File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ namespace Aliyun.OTS.DataModel.Search
55{
66 public enum Analyzer
77 {
8-
8+ NotAnalyzed ,
99 SingleWord ,
1010 MaxWord
1111
Original file line number Diff line number Diff line change 66 /// </summary>
77 public enum IndexOptions
88 {
9+ NULL ,
910 DOCS ,
1011 FREQS ,
1112 POSITIONS ,
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ private IMessage EncodeCreateSearchIndex(Request.OTSRequest request)
374374 var requestReal = ( Request . CreateSearchIndexRequest ) request ;
375375 var builder = PB . CreateSearchIndexRequest . CreateBuilder ( ) ;
376376 builder . SetTableName ( requestReal . TableName ) ;
377- builder . SetIndexName ( requestReal . IndexName ) ;
377+ builder . SetIndexName ( requestReal . IndexName ) ;
378378 builder . SetSchema ( EncodeIndexSchema ( requestReal . IndexSchame ) ) ;
379379 return builder . Build ( ) ;
380380 }
@@ -515,8 +515,11 @@ private PB.FieldSchema EncodingFieldSchema(DataModel.Search.FieldSchema fieldSch
515515 builder . IsArray = fieldSchema . IsArray ;
516516 }
517517
518- builder . IndexOptions = EncodingIndexOptions ( fieldSchema . IndexOptions ) ;
519- if ( fieldSchema . FieldType == DataModel . Search . FieldType . TEXT )
518+ if ( fieldSchema . IndexOptions != DataModel . Search . IndexOptions . NULL )
519+ {
520+ builder . IndexOptions = EncodingIndexOptions ( fieldSchema . IndexOptions ) ;
521+ }
522+ if ( fieldSchema . Analyzer != DataModel . Search . Analyzer . NotAnalyzed )
520523 {
521524 builder . Analyzer = EncodingAnalyzer ( fieldSchema . Analyzer ) ;
522525 }
@@ -525,7 +528,7 @@ private PB.FieldSchema EncodingFieldSchema(DataModel.Search.FieldSchema fieldSch
525528 {
526529 for ( var i = 0 ; i < fieldSchema . SubFieldSchemas . Count ; i ++ )
527530 {
528- builder . SetFieldSchemas ( i , EncodingFieldSchema ( fieldSchema . SubFieldSchemas [ i ] ) ) ;
531+ builder . AddFieldSchemas ( EncodingFieldSchema ( fieldSchema . SubFieldSchemas [ i ] ) ) ;
529532 }
530533 }
531534
You can’t perform that action at this time.
0 commit comments