(hit *search.DocumentMatch)
| 34 | } |
| 35 | |
| 36 | func (dph *docDelHandler) documentMatchHandler(hit *search.DocumentMatch) error { |
| 37 | if hit != nil { |
| 38 | dph.batch.Delete(hit.ID) |
| 39 | } |
| 40 | if dph.batch.Size() >= deleteBatchSize || hit == nil { |
| 41 | err := dph.delh.index.Batch(dph.batch) |
| 42 | if err != nil { |
| 43 | return err |
| 44 | } |
| 45 | dph.delh.totDelCount += dph.batch.Size() |
| 46 | dph.batch.Reset() |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | func (d *delByQueryHandler) MakeDocumentMatchHandler( |
| 52 | ctx *search.SearchContext) (search.DocumentMatchHandler, bool, error) { |