entity

package
v0.0.0-...-683a4be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2020 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Overview

Package entity is the package where we store and manage elasthink's core entity

Index

Constants

This section is empty.

Variables

View Source
var Entity entityData

Functions

This section is empty.

Types

type DocumentType

type DocumentType string

DocumentType is a type that represent document type

const (

	//AdvertisementCampaignDocument is the document type that represent Advertisement Campaign document type
	AdvertisementCampaignDocument DocumentType = "advcampaign"
	//CampaignDocument is the document type that represent Campaign document type (coupon for promotion)
	CampaignDocument DocumentType = "campaign"
)

func (DocumentType) IsValidFromCustomDocumentType

func (dt DocumentType) IsValidFromCustomDocumentType(documentTypeMap map[DocumentType]int) error

//IsValid checks if the document type is a valid (registered) document type in entity const

func (dt DocumentType) IsValid() error {
	switch dt {
	case AdvertisementCampaignDocument, CampaignDocument:
		return nil
	}
	return errors.New("Invalid Document Type")
}

IsValidFromCustomType checks if the document type is a valid (registered) in a documentTypeMap (Custom Document Type)

type SearchResultRankData

type SearchResultRankData struct {
	ID        int64 `json:"id"`
	ShowCount int   `json:"showCount"`
	Rank      int   `json:"rank"`
}

SearchResultRankData is the core struct that represent search result rank item

type StopwordData

type StopwordData struct {
	Words []string `json:"words"` //Words is a collection of stopwords for a specified language
}

StopwordData is a struct that represent stopwords data that we have in a file for a specified language

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL