Skip to content

Commit

Permalink
Streamline interface
Browse files Browse the repository at this point in the history
  • Loading branch information
svera authored Dec 20, 2024
1 parent de3fa10 commit d7b865b
Show file tree
Hide file tree
Showing 20 changed files with 347 additions and 284 deletions.
8 changes: 8 additions & 0 deletions internal/index/bleve_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ func (b *BleveIndexer) SameSubjects(slugID string, quantity int) ([]Document, er
return []Document{}, err
}

if len(doc.Subjects) == 0 {
return []Document{}, err
}

bq := bleve.NewBooleanQuery()
subjectsCompoundQuery := bleve.NewDisjunctionQuery()

Expand Down Expand Up @@ -294,6 +298,10 @@ func (b *BleveIndexer) SameAuthors(slugID string, quantity int) ([]Document, err
return []Document{}, err
}

if len(doc.Authors) == 0 {
return []Document{}, err
}

authorsCompoundQuery := bleve.NewDisjunctionQuery()
for _, slug := range doc.AuthorsSlugs {
qu := bleve.NewTermQuery(slug)
Expand Down
Loading

0 comments on commit d7b865b

Please sign in to comment.