diff --git a/Makefile b/Makefile index 4afaeaa54..6663d3efb 100644 --- a/Makefile +++ b/Makefile @@ -339,7 +339,7 @@ endif ### Tantivy Section REPO := anyproto/tantivy-go -VERSION := v0.0.9 +VERSION := v0.1.0 OUTPUT_DIR := deps/libs SHA_FILE = tantivity_sha256.txt @@ -363,7 +363,10 @@ define remove_arch rm -f $(OUTPUT_DIR)/$(1) endef -download-tantivy: $(TANTIVY_LIBS) +remove-libs: + @rm -rf deps/libs/* + +download-tantivy: remove-libs $(TANTIVY_LIBS) $(TANTIVY_LIBS): @mkdir -p $(OUTPUT_DIR)/$(shell echo $@ | cut -d'.' -f1) @@ -371,20 +374,20 @@ $(TANTIVY_LIBS): @tar -C $(OUTPUT_DIR)/$(shell echo $@ | cut -d'.' -f1) -xvzf $(OUTPUT_DIR)/$@ download-tantivy-all-force: download-tantivy - @rm -f $(SHA_FILE) + rm -f $(SHA_FILE) @for file in $(TANTIVY_LIBS); do \ echo "SHA256 $(OUTPUT_DIR)/$$file" ; \ shasum -a 256 $(OUTPUT_DIR)/$$file | awk '{print $$1 " " "'$(OUTPUT_DIR)/$$file'" }' >> $(SHA_FILE); \ done + @rm -rf deps/libs/*.tar.gz @echo "SHA256 checksums generated." download-tantivy-all: download-tantivy - @rm -rf /deps/libs/* @echo "Validating SHA256 checksums..." @shasum -a 256 -c $(SHA_FILE) --status || { echo "Hash mismatch detected."; exit 1; } @echo "All files are valid." + @rm -rf deps/libs/*.tar.gz -download-tantivy-local: - @rm -rf /deps/libs/* +download-tantivy-local: remove-libs @mkdir -p $(OUTPUT_DIR) @cp -r $(TANTIVY_GO_PATH)/libs/ $(OUTPUT_DIR) \ No newline at end of file diff --git a/go.mod b/go.mod index 4b9c64022..daa65f6ab 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/anyproto/any-store v0.0.2-0.20240812125400-7f6f6d062ebf github.com/anyproto/any-sync v0.4.30 github.com/anyproto/go-naturaldate/v2 v2.0.2-0.20230524105841-9829cfd13438 - github.com/anyproto/tantivy-go v0.0.9 + github.com/anyproto/tantivy-go v0.1.0 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/avast/retry-go/v4 v4.6.0 github.com/blevesearch/bleve/v2 v2.3.10 diff --git a/go.sum b/go.sum index ce88f593c..fa0f80e51 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/anyproto/protobuf v1.3.3-0.20240201225420-6e325cf0ac38 h1:80jke82/c+b github.com/anyproto/protobuf v1.3.3-0.20240201225420-6e325cf0ac38/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/anyproto/ristretto v0.1.2-0.20240221153107-2b23839cc50c h1:GicoaTUyB2mtCIl3YMrO0OzysqRT5GA4vuvDsqEkhSM= github.com/anyproto/ristretto v0.1.2-0.20240221153107-2b23839cc50c/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/anyproto/tantivy-go v0.0.9 h1:lbRBH5Nzs1nlSWKBlC9UuyOEqhM/KEs8P02Cvt58WP8= -github.com/anyproto/tantivy-go v0.0.9/go.mod h1:Pl0zaeEX7dkVDTDKROzlLlGCVjbZHjyPrZloFuVEASc= +github.com/anyproto/tantivy-go v0.1.0 h1:5SuItuJnYAEK9U6cfxPnwFUXGboURIwF4JAp7s46rII= +github.com/anyproto/tantivy-go v0.1.0/go.mod h1:Pl0zaeEX7dkVDTDKROzlLlGCVjbZHjyPrZloFuVEASc= github.com/anyproto/zeroconf/v2 v2.2.1-0.20240228113933-f90a5cc4439d h1:5bj7nX/AS8sxGpTIrapE7PC4oPlhkHMwMqXlJbUHBlg= github.com/anyproto/zeroconf/v2 v2.2.1-0.20240228113933-f90a5cc4439d/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= diff --git a/pkg/lib/localstore/ftsearch/autobatchertantivy.go b/pkg/lib/localstore/ftsearch/autobatchertantivy.go index c15feb186..968739103 100644 --- a/pkg/lib/localstore/ftsearch/autobatchertantivy.go +++ b/pkg/lib/localstore/ftsearch/autobatchertantivy.go @@ -73,7 +73,7 @@ func (f *ftSearchTantivy) Iterate(objectId string, fields []string, shouldContin } type ftIndexBatcherTantivy struct { - index *tantivy.Index + index *tantivy.TantivyContext deleteIds []string updateDocs []*tantivy.Document } diff --git a/pkg/lib/localstore/ftsearch/ftsearchtantivy.go b/pkg/lib/localstore/ftsearch/ftsearchtantivy.go index 19c14feb6..00e5c790e 100644 --- a/pkg/lib/localstore/ftsearch/ftsearchtantivy.go +++ b/pkg/lib/localstore/ftsearch/ftsearchtantivy.go @@ -45,7 +45,7 @@ type ftSearchTantivy struct { rootPath string ftsPath string builderId string - index *tantivy.Index + index *tantivy.TantivyContext schema *tantivy.Schema parserPool *fastjson.ParserPool } @@ -159,7 +159,7 @@ func (f *ftSearchTantivy) Run(context.Context) error { return err } - index, err := tantivy.NewIndexWithSchema(f.ftsPath, schema) + index, err := tantivy.NewTantivyContextWithSchema(f.ftsPath, schema) if err != nil { return err } diff --git a/tantivity_sha256.txt b/tantivity_sha256.txt index 689421682..e7ab01e6f 100644 --- a/tantivity_sha256.txt +++ b/tantivity_sha256.txt @@ -1,11 +1,11 @@ -ae7b1f9899be6b310aaf7678dfb19c5b4a1ad19fff967a525ab6b30e4730bd77 deps/libs/android-386.tar.gz -b86d874ba76de4f16d43e86cd2ab1f597f5e4b671f39827c018b18558b5333b7 deps/libs/android-amd64.tar.gz -b5796dbcaa501eecb5568ff44bb280099a10e6ec7607383e6fa88dc126c97b11 deps/libs/android-arm.tar.gz -096a55e25df9ccae19b026c628fa3b8f21eb76f70b617d0fcaf2a0dbc291f59c deps/libs/android-arm64.tar.gz -28ab38b8fd0796c07406a15183a29223057e2193365502e7dfe1e88ae86c90b6 deps/libs/darwin-amd64.tar.gz -247e5d6b9eb8d6c5d65f9c44795aaac40499e781715c1d1769151bf8874b7509 deps/libs/darwin-arm64.tar.gz -2ea69b27b42b1e0ef08817c778d6f9a890a9900f22bbab10a1c229ec19d08304 deps/libs/ios-amd64.tar.gz -553fd2feb0ac055eb8c09f076cfcebc455309ca9f4cc37cf2d76e17654b7471d deps/libs/ios-arm64.tar.gz -a1f27b2c55c3fabe16367041706da72dd57ba30f768b227161212a0cf8e50290 deps/libs/ios-arm64-sim.tar.gz -63c5384d4034875e4302d5d583ac6ccae64a88fe73de931cb885f9a75c777408 deps/libs/linux-amd64-musl.tar.gz -de00e402a6bbdf3f77bd91ddc486c4572a630f4332712c72098ecef931350065 deps/libs/windows-amd64.tar.gz +7a472fd61b7c32b1aecc130a0d65a0b1e36f404c97144b2dc993c7bfe628ea6b deps/libs/android-386.tar.gz +7c3902588b98d6c4951124b8ded78b956448483a057c03e7ef85cb05182a7afd deps/libs/android-amd64.tar.gz +f12a6a9b2904a67a7cec36863a65dc128b8efd9c6968db29bb7904ca79040381 deps/libs/android-arm.tar.gz +d15a085afb2887a839697080101772525b614667924c5df98aa212ae3d72a825 deps/libs/android-arm64.tar.gz +dc6eca09d7946dbf0b0fd7615be555edfc6d6f1be9a47dd757d90626a6d05c09 deps/libs/darwin-amd64.tar.gz +216a751320edb4e5e737ebeb7eb3181fbdab71f2ec4d441621ce723056a5bc03 deps/libs/darwin-arm64.tar.gz +87d629216a127eb29064cb3d1dca63ef360d1920330bfcbecf0ca78e35f37756 deps/libs/ios-amd64.tar.gz +4a82c10a149f84073af08f2cf85dce680fd3301fc7cd19279227dddd60effbcc deps/libs/ios-arm64.tar.gz +b55ecde8d30fd38ab12ffe2d51415b2c7a74ff5af7b61cd35c401345a33a482d deps/libs/ios-arm64-sim.tar.gz +a514c9e61dd8e6fea7c5236cf359ffd14bc2fd5db52fc1ca8b0e3df10a00cbcd deps/libs/linux-amd64-musl.tar.gz +3bbab5b3a28cab4306b3ced4dd0c60f06a85e01592367ccf910f3a59c7db674b deps/libs/windows-amd64.tar.gz