chore(python): handle NaN input in fts ingestion (#763)

If the input text is None, Tantivy raises an error
complaining it cannot add a NoneType. We handle this
upstream so None's are not added to the document.
If all of the indexed fields are None then we skip
this document.
This commit is contained in:
Chang She
2024-01-04 11:45:12 -08:00
committed by Andrew Miracle
parent 5b1587d84a
commit 30a8223944
2 changed files with 21 additions and 3 deletions

View File

@@ -147,3 +147,18 @@ def test_search_index_with_filter(table):
assert r["id"] == 1
assert rs == rs2
def test_null_input(table):
table.add(
[
{
"vector": np.random.randn(128),
"id": 101,
"text": None,
"text2": None,
"nested": {"text": None},
}
]
)
table.create_fts_index("text")