IsIndexed checks if the given content hash has already been indexed
(hash string)
| 158 | |
| 159 | // IsIndexed checks if the given content hash has already been indexed |
| 160 | func (e *Engine) IsIndexed(hash string) bool { |
| 161 | if hash == "" { |
| 162 | return false |
| 163 | } |
| 164 | d, err := e.index.Document(hash) |
| 165 | if err == nil && d != nil && d.ID == hash { |
| 166 | return true |
| 167 | } |
| 168 | return false |
| 169 | } |
| 170 | |
| 171 | // Search performs a query |
| 172 | func (e *Engine) Search(ctx context.Context, q Query) ([]Result, error) { |