Example #1
0
func init() {
	// Register alias with empty instantiation functions,
	// so that "alias" will show up in valid index types.
	cbgt.RegisterPIndexImplType("alias", &cbgt.PIndexImplType{
		Validate: ValidateAlias,
		Count:    CountAlias,
		Query:    QueryAlias,
		Description: "advanced/alias" +
			" - an alias provides a naming level of indirection" +
			" to one or more actual, target indexes",
		StartSample: &AliasParams{
			Targets: map[string]*AliasParamsTarget{
				"yourIndexName": &AliasParamsTarget{},
			},
		},
	})
}
Example #2
0
func init() {
	cbgt.RegisterPIndexImplType("bleve", &cbgt.PIndexImplType{
		Validate: ValidateBlevePIndexImpl,

		New:   NewBlevePIndexImpl,
		Open:  OpenBlevePIndexImpl,
		Count: CountBlevePIndexImpl,
		Query: QueryBlevePIndexImpl,

		Description: "general/full-text (bleve)" +
			" - a full-text index powered by the bleve engine",
		StartSample:  NewBleveParams(),
		QuerySamples: BlevePIndexQuerySamples,
		QueryHelp:    bleveQueryHelp,
		InitRouter:   BlevePIndexImplInitRouter,
		DiagHandlers: []cbgt.DiagHandler{
			{"/api/pindex-bleve", bleveHttp.NewListIndexesHandler(), nil},
		},
		MetaExtra: BleveMetaExtra,
	})
}