Skip to content

Commit 1982cf5

Browse files
committed
GO-4414 Add an ability to test search quality
1 parent ba9c4d9 commit 1982cf5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

example/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ func main() {
109109
}
110110

111111
// Add fields to document
112-
err = doc.AddField(NameTitle, "Example Title", index)
112+
err = doc.AddField("Example Title", index, NameTitle)
113113
if err != nil {
114114
fmt.Println("Failed to add field to document:", err)
115115
return
116116
}
117117

118-
err = doc.AddField(NameId, "1", index)
118+
err = doc.AddField("1", index, NameId)
119119
if err != nil {
120120
fmt.Println("Failed to add field to document:", err)
121121
return
122122
}
123123

124-
err = doc.AddField(NameBody, "Example body content.", index)
124+
err = doc.AddField("Example body content.", index, NameBody)
125125
if err != nil {
126126
fmt.Println("Failed to add field to document:", err)
127127
return
@@ -160,7 +160,7 @@ func main() {
160160
break
161161
}
162162
// Get JSON representation of the document
163-
jsonStr, err := doc.ToJson(schema, NameId, NameTitle, NameBody)
163+
jsonStr, err := doc.ToJson(index, NameId, NameTitle, NameBody)
164164
if err != nil {
165165
fmt.Println("Failed to get document JSON:", err)
166166
} else {

rust/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ logcall = "0.1.11"
2222
lazy_static = "1.5.0"
2323
tantivy-jieba = { git = "https://github.com/anyproto/tantivy-jieba.git", rev = "ca11d3153b8844cbc43cd243667e03f56f6d1e18", optional = true }
2424
phf = { version = "0.11.2", features = ["macros"] }
25+
crunchy = "=0.2.2" #https://github.com/eira-fransham/crunchy/issues/13
2526

2627
[features]
2728
default = ["jieba"]

0 commit comments

Comments
 (0)