diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-04-06 17:53:34 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-04-06 17:53:34 -0700 |
commit | ba201f640c883d5ed2f3e1f68daff3a7ee4c8b9f (patch) | |
tree | f3640ff2fabd1b45b62a0f045ba19289ebb5625c /system/item | |
parent | bf15dcfa48a46991f3c6d90f50aa491b5a15d5df (diff) |
renaming and add Delete operation for search index
Diffstat (limited to 'system/item')
-rw-r--r-- | system/item/item.go | 4 | ||||
-rw-r--r-- | system/item/types.go | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/system/item/item.go b/system/item/item.go index 5babf35..4750ef5 100644 --- a/system/item/item.go +++ b/system/item/item.go @@ -212,11 +212,11 @@ func (i Item) AfterReject(res http.ResponseWriter, req *http.Request) error { // SearchMapping returns a default implementation of a Bleve IndexMappingImpl // partially implements db.Searchable -func (i Item) SearchMapping() *mapping.IndexMappingImpl { +func (i Item) SearchMapping() (*mapping.IndexMappingImpl, error) { mapping := bleve.NewIndexMapping() mapping.StoreDynamic = false - return mapping + return mapping, nil } // Slug returns a URL friendly string from the title of a post item diff --git a/system/item/types.go b/system/item/types.go index bcae58a..dbf13af 100644 --- a/system/item/types.go +++ b/system/item/types.go @@ -26,6 +26,9 @@ var ( // if requested by a valid admin or user ErrAllowHiddenItem = errors.New(`Allow hidden item`) + // ErrNoSearchMapping can be used to tell the system not to create an index mapping + ErrNoSearchMapping = errors.New(`No search mapping for item`) + // Types is a map used to reference a type name to its actual Editable type // mainly for lookups in /admin route based utilities Types map[string]func() interface{} |