summaryrefslogtreecommitdiff
path: root/system/item
diff options
context:
space:
mode:
Diffstat (limited to 'system/item')
-rw-r--r--system/item/item.go4
-rw-r--r--system/item/types.go3
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{}