feat(medusa): Migrate SearchService to TS + add SearchInterface (#1922)
This commit is contained in:
@@ -3,17 +3,17 @@ import { SEARCH_INDEX_EVENT } from "../loaders/search-index"
|
||||
import ProductService from "../services/product"
|
||||
import { indexTypes } from "medusa-core-utils"
|
||||
import { Product } from "../models"
|
||||
import { SearchService } from "../services"
|
||||
import { ISearchService } from "../interfaces"
|
||||
|
||||
type InjectedDependencies = {
|
||||
eventBusService: EventBusService
|
||||
searchService: SearchService
|
||||
searchService: ISearchService<never>
|
||||
productService: ProductService
|
||||
}
|
||||
|
||||
class SearchIndexingSubscriber {
|
||||
private readonly eventBusService_: EventBusService
|
||||
private readonly searchService_: SearchService
|
||||
private readonly searchService_: ISearchService<never>
|
||||
private readonly productService_: ProductService
|
||||
|
||||
constructor({
|
||||
@@ -29,7 +29,7 @@ class SearchIndexingSubscriber {
|
||||
}
|
||||
|
||||
indexDocuments = async (): Promise<void> => {
|
||||
const TAKE = this.searchService_?.options?.batch_size ?? 1000
|
||||
const TAKE = (this.searchService_?.options?.batch_size as number) ?? 1000
|
||||
let hasMore = true
|
||||
|
||||
let lastSeenId = ""
|
||||
|
||||
Reference in New Issue
Block a user