[Groonga-commit] groonga/grngo at c908a22 [master] Update GetValue() to support Text vector (still buggy).

Back to archive index

susumu.yata null+****@clear*****
Fri Jul 24 19:20:59 JST 2015


susumu.yata	2015-07-24 19:20:59 +0900 (Fri, 24 Jul 2015)

  New Revision: c908a2294ccb4410b8ac0674d8087cc91d340a05
  https://github.com/groonga/grngo/commit/c908a2294ccb4410b8ac0674d8087cc91d340a05

  Message:
    Update GetValue() to support Text vector (still buggy).

  Modified files:
    grngo.go

  Modified: grngo.go (+6 -1)
===================================================================
--- grngo.go    2015-07-24 19:07:47 +0900 (5b82f54)
+++ grngo.go    2015-07-24 19:20:59 +0900 (512db61)
@@ -1170,7 +1170,12 @@ func (column *Column) GetValue(id uint32) (interface{}, error) {
 			}
 			return value, nil
 		case C.GRN_DB_SHORT_TEXT, C.GRN_DB_TEXT, C.GRN_DB_LONG_TEXT:
-			return nil, fmt.Errorf("not supported yet")
+      cValue := *(*[]C.grngo_text)(unsafe.Pointer(&header))
+			value := make([][]byte, len(cValue))
+			for i := 0; i < len(value); i++ {
+				value[i] = C.GoBytes(unsafe.Pointer(cValue[i].ptr), C.int(cValue[i].size))
+			}
+			return value, nil
 		case C.GRN_DB_TOKYO_GEO_POINT, C.GRN_DB_WGS84_GEO_POINT:
       cValue := *(*[]C.grn_geo_point)(unsafe.Pointer(&header))
 			value := make([]GeoPoint, len(cValue))
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index