[Groonga-commit] pgroonga/pgroonga at acbf4fe [master] Support combination of full-text search index and other index

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 15 20:18:14 JST 2015


Kouhei Sutou	2015-02-15 20:18:14 +0900 (Sun, 15 Feb 2015)

  New Revision: acbf4fe7257dd33ba3ae9712bf1fb019e8b16307
  https://github.com/pgroonga/pgroonga/commit/acbf4fe7257dd33ba3ae9712bf1fb019e8b16307

  Message:
    Support combination of full-text search index and other index

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+4 -4)
===================================================================
--- pgroonga.c    2015-02-15 14:54:38 +0900 (aa063ef)
+++ pgroonga.c    2015-02-15 20:18:14 +0900 (d86bfdf)
@@ -550,13 +550,13 @@ PGrnCreateColumn(grn_obj	*table,
 }
 
 static bool
-PGrnIsForFullTextSearchIndex(Relation index)
+PGrnIsForFullTextSearchIndex(Relation index, int nthAttribute)
 {
 	Oid queryStrategyOID;
 	Oid leftType;
 	Oid rightType;
 
-	leftType = index->rd_opcintype[0];
+	leftType = index->rd_opcintype[nthAttribute];
 	switch (leftType)
 	{
 	case VARCHARARRAYOID:
@@ -569,7 +569,7 @@ PGrnIsForFullTextSearchIndex(Relation index)
 		rightType = leftType;
 		break;
 	}
-	queryStrategyOID = get_opfamily_member(index->rd_opfamily[0],
+	queryStrategyOID = get_opfamily_member(index->rd_opfamily[nthAttribute],
 										   leftType,
 										   rightType,
 										   PGrnQueryStrategyNumber);
@@ -691,10 +691,10 @@ PGrnCreate(Relation index, grn_obj **idsTable, grn_obj *lexicons)
 								grn_ctx_at(ctx, GRN_DB_UINT64));
 	data.idsTable = *idsTable;
 	data.lexicons = lexicons;
-	data.forFullTextSearch = PGrnIsForFullTextSearchIndex(index);
 
 	for (data.i = 0; data.i < data.desc->natts; data.i++)
 	{
+		data.forFullTextSearch = PGrnIsForFullTextSearchIndex(index, data.i);
 		data.attributeTypeID = PGrnGetType(index, data.i,
 										   &(data.attributeFlags));
 		PGrnCreateDataColumn(&data);
-------------- next part --------------
HTML����������������������������...
Download 



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