mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-07 12:22:59 +00:00
Compare commits
1 Commits
python-v0.
...
v0.22.3-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b38735763 |
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -4684,7 +4684,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lancedb"
|
name = "lancedb"
|
||||||
version = "0.22.3-beta.4"
|
version = "0.22.3-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -4781,7 +4781,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lancedb-nodejs"
|
name = "lancedb-nodejs"
|
||||||
version = "0.22.3-beta.4"
|
version = "0.22.3-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrow-array",
|
"arrow-array",
|
||||||
"arrow-ipc",
|
"arrow-ipc",
|
||||||
@@ -4801,7 +4801,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lancedb-python"
|
name = "lancedb-python"
|
||||||
version = "0.25.3-beta.4"
|
version = "0.25.3-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrow",
|
"arrow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
4
nodejs/package-lock.json
generated
4
nodejs/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@lancedb/lancedb",
|
"name": "@lancedb/lancedb",
|
||||||
"version": "0.22.3-beta.4",
|
"version": "0.22.3-beta.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lancedb/lancedb",
|
"name": "@lancedb/lancedb",
|
||||||
"version": "0.22.3-beta.4",
|
"version": "0.22.3-beta.3",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64",
|
"x64",
|
||||||
"arm64"
|
"arm64"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.25.3-beta.5"
|
current_version = "0.25.3-beta.4"
|
||||||
parse = """(?x)
|
parse = """(?x)
|
||||||
(?P<major>0|[1-9]\\d*)\\.
|
(?P<major>0|[1-9]\\d*)\\.
|
||||||
(?P<minor>0|[1-9]\\d*)\\.
|
(?P<minor>0|[1-9]\\d*)\\.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lancedb-python"
|
name = "lancedb-python"
|
||||||
version = "0.25.3-beta.5"
|
version = "0.25.3-beta.4"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
description = "Python bindings for LanceDB"
|
description = "Python bindings for LanceDB"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|||||||
@@ -339,4 +339,3 @@ class AsyncPermutationBuilder:
|
|||||||
def async_permutation_builder(
|
def async_permutation_builder(
|
||||||
table: Table, dest_table_name: str
|
table: Table, dest_table_name: str
|
||||||
) -> AsyncPermutationBuilder: ...
|
) -> AsyncPermutationBuilder: ...
|
||||||
def fts_query_to_json(query: Any) -> str: ...
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ from .rerankers.base import Reranker
|
|||||||
from .rerankers.rrf import RRFReranker
|
from .rerankers.rrf import RRFReranker
|
||||||
from .rerankers.util import check_reranker_result
|
from .rerankers.util import check_reranker_result
|
||||||
from .util import flatten_columns
|
from .util import flatten_columns
|
||||||
from lancedb._lancedb import fts_query_to_json
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -124,24 +124,6 @@ class FullTextQuery(ABC):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def to_json(self) -> str:
|
|
||||||
"""
|
|
||||||
Convert the query to a JSON string.
|
|
||||||
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
str
|
|
||||||
A JSON string representation of the query.
|
|
||||||
|
|
||||||
Examples
|
|
||||||
--------
|
|
||||||
>>> from lancedb.query import MatchQuery
|
|
||||||
>>> query = MatchQuery("puppy", "text", fuzziness=2)
|
|
||||||
>>> query.to_json()
|
|
||||||
'{"match":{"column":"text","terms":"puppy","boost":1.0,"fuzziness":2,"max_expansions":50,"operator":"Or","prefix_length":0}}'
|
|
||||||
"""
|
|
||||||
return fts_query_to_json(self)
|
|
||||||
|
|
||||||
def __and__(self, other: "FullTextQuery") -> "FullTextQuery":
|
def __and__(self, other: "FullTextQuery") -> "FullTextQuery":
|
||||||
"""
|
"""
|
||||||
Combine two queries with a logical AND operation.
|
Combine two queries with a logical AND operation.
|
||||||
@@ -306,8 +288,6 @@ class BooleanQuery(FullTextQuery):
|
|||||||
----------
|
----------
|
||||||
queries : list[tuple(Occur, FullTextQuery)]
|
queries : list[tuple(Occur, FullTextQuery)]
|
||||||
The list of queries with their occurrence requirements.
|
The list of queries with their occurrence requirements.
|
||||||
Each tuple contains an Occur value (MUST, SHOULD, or MUST_NOT)
|
|
||||||
and a FullTextQuery to apply.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
queries: list[tuple[Occur, FullTextQuery]]
|
queries: list[tuple[Occur, FullTextQuery]]
|
||||||
|
|||||||
@@ -20,14 +20,7 @@ from unittest import mock
|
|||||||
import lancedb as ldb
|
import lancedb as ldb
|
||||||
from lancedb.db import DBConnection
|
from lancedb.db import DBConnection
|
||||||
from lancedb.index import FTS
|
from lancedb.index import FTS
|
||||||
from lancedb.query import (
|
from lancedb.query import BoostQuery, MatchQuery, MultiMatchQuery, PhraseQuery
|
||||||
BoostQuery,
|
|
||||||
MatchQuery,
|
|
||||||
MultiMatchQuery,
|
|
||||||
PhraseQuery,
|
|
||||||
BooleanQuery,
|
|
||||||
Occur,
|
|
||||||
)
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pyarrow as pa
|
import pyarrow as pa
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -734,146 +727,3 @@ def test_fts_ngram(mem_db: DBConnection):
|
|||||||
results = table.search("la", query_type="fts").limit(10).to_list()
|
results = table.search("la", query_type="fts").limit(10).to_list()
|
||||||
assert len(results) == 2
|
assert len(results) == 2
|
||||||
assert set(r["text"] for r in results) == {"lance database", "lance is cool"}
|
assert set(r["text"] for r in results) == {"lance database", "lance is cool"}
|
||||||
|
|
||||||
|
|
||||||
def test_fts_query_to_json():
|
|
||||||
"""Test that FTS query to_json() produces valid JSON strings with exact format."""
|
|
||||||
|
|
||||||
# Test MatchQuery - basic
|
|
||||||
match_query = MatchQuery("hello world", "text")
|
|
||||||
json_str = match_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"match":{"column":"text","terms":"hello world","boost":1.0,'
|
|
||||||
'"fuzziness":0,"max_expansions":50,"operator":"Or","prefix_length":0}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test MatchQuery with options
|
|
||||||
match_query = MatchQuery("puppy", "text", fuzziness=2, boost=1.5, prefix_length=3)
|
|
||||||
json_str = match_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"match":{"column":"text","terms":"puppy","boost":1.5,"fuzziness":2,'
|
|
||||||
'"max_expansions":50,"operator":"Or","prefix_length":3}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test PhraseQuery
|
|
||||||
phrase_query = PhraseQuery("quick brown fox", "title")
|
|
||||||
json_str = phrase_query.to_json()
|
|
||||||
expected = '{"phrase":{"column":"title","terms":"quick brown fox","slop":0}}'
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test PhraseQuery with slop
|
|
||||||
phrase_query = PhraseQuery("quick brown", "title", slop=2)
|
|
||||||
json_str = phrase_query.to_json()
|
|
||||||
expected = '{"phrase":{"column":"title","terms":"quick brown","slop":2}}'
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test BooleanQuery with MUST
|
|
||||||
must_query = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.MUST, MatchQuery("puppy", "text")),
|
|
||||||
(Occur.MUST, MatchQuery("runs", "text")),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
json_str = must_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"boolean":{"should":[],"must":[{"match":{"column":"text","terms":"puppy",'
|
|
||||||
'"boost":1.0,"fuzziness":0,"max_expansions":50,"operator":"Or",'
|
|
||||||
'"prefix_length":0}},{"match":{"column":"text","terms":"runs","boost":1.0,'
|
|
||||||
'"fuzziness":0,"max_expansions":50,"operator":"Or","prefix_length":0}}],'
|
|
||||||
'"must_not":[]}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test BooleanQuery with SHOULD
|
|
||||||
should_query = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.SHOULD, MatchQuery("cat", "text")),
|
|
||||||
(Occur.SHOULD, MatchQuery("dog", "text")),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
json_str = should_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"boolean":{"should":[{"match":{"column":"text","terms":"cat","boost":1.0,'
|
|
||||||
'"fuzziness":0,"max_expansions":50,"operator":"Or","prefix_length":0}},'
|
|
||||||
'{"match":{"column":"text","terms":"dog","boost":1.0,"fuzziness":0,'
|
|
||||||
'"max_expansions":50,"operator":"Or","prefix_length":0}}],"must":[],'
|
|
||||||
'"must_not":[]}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test BooleanQuery with MUST_NOT
|
|
||||||
must_not_query = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.MUST, MatchQuery("puppy", "text")),
|
|
||||||
(Occur.MUST_NOT, MatchQuery("training", "text")),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
json_str = must_not_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"boolean":{"should":[],"must":[{"match":{"column":"text","terms":"puppy",'
|
|
||||||
'"boost":1.0,"fuzziness":0,"max_expansions":50,"operator":"Or",'
|
|
||||||
'"prefix_length":0}}],"must_not":[{"match":{"column":"text",'
|
|
||||||
'"terms":"training","boost":1.0,"fuzziness":0,"max_expansions":50,'
|
|
||||||
'"operator":"Or","prefix_length":0}}]}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test BoostQuery
|
|
||||||
positive = MatchQuery("puppy", "text")
|
|
||||||
negative = MatchQuery("training", "text")
|
|
||||||
boost_query = BoostQuery(positive, negative, negative_boost=0.3)
|
|
||||||
json_str = boost_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"boost":{"positive":{"match":{"column":"text","terms":"puppy",'
|
|
||||||
'"boost":1.0,"fuzziness":0,"max_expansions":50,"operator":"Or",'
|
|
||||||
'"prefix_length":0}},"negative":{"match":{"column":"text",'
|
|
||||||
'"terms":"training","boost":1.0,"fuzziness":0,"max_expansions":50,'
|
|
||||||
'"operator":"Or","prefix_length":0}},"negative_boost":0.3}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test MultiMatchQuery
|
|
||||||
multi_match = MultiMatchQuery("python", ["tags", "title"])
|
|
||||||
json_str = multi_match.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"multi_match":{"query":"python","columns":["tags","title"],'
|
|
||||||
'"boost":[1.0,1.0]}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|
||||||
# Test complex nested BooleanQuery
|
|
||||||
inner1 = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.MUST, MatchQuery("python", "tags")),
|
|
||||||
(Occur.MUST, MatchQuery("tutorial", "title")),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
inner2 = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.MUST, MatchQuery("rust", "tags")),
|
|
||||||
(Occur.MUST, MatchQuery("guide", "title")),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
complex_query = BooleanQuery(
|
|
||||||
[
|
|
||||||
(Occur.SHOULD, inner1),
|
|
||||||
(Occur.SHOULD, inner2),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
json_str = complex_query.to_json()
|
|
||||||
expected = (
|
|
||||||
'{"boolean":{"should":[{"boolean":{"should":[],"must":[{"match":'
|
|
||||||
'{"column":"tags","terms":"python","boost":1.0,"fuzziness":0,'
|
|
||||||
'"max_expansions":50,"operator":"Or","prefix_length":0}},{"match":'
|
|
||||||
'{"column":"title","terms":"tutorial","boost":1.0,"fuzziness":0,'
|
|
||||||
'"max_expansions":50,"operator":"Or","prefix_length":0}}],"must_not":[]}}'
|
|
||||||
',{"boolean":{"should":[],"must":[{"match":{"column":"tags",'
|
|
||||||
'"terms":"rust","boost":1.0,"fuzziness":0,"max_expansions":50,'
|
|
||||||
'"operator":"Or","prefix_length":0}},{"match":{"column":"title",'
|
|
||||||
'"terms":"guide","boost":1.0,"fuzziness":0,"max_expansions":50,'
|
|
||||||
'"operator":"Or","prefix_length":0}}],"must_not":[]}}],"must":[],'
|
|
||||||
'"must_not":[]}}'
|
|
||||||
)
|
|
||||||
assert json_str == expected
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ pub fn _lancedb(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|||||||
m.add_function(wrap_pyfunction!(connect, m)?)?;
|
m.add_function(wrap_pyfunction!(connect, m)?)?;
|
||||||
m.add_function(wrap_pyfunction!(permutation::async_permutation_builder, m)?)?;
|
m.add_function(wrap_pyfunction!(permutation::async_permutation_builder, m)?)?;
|
||||||
m.add_function(wrap_pyfunction!(util::validate_table_name, m)?)?;
|
m.add_function(wrap_pyfunction!(util::validate_table_name, m)?)?;
|
||||||
m.add_function(wrap_pyfunction!(query::fts_query_to_json, m)?)?;
|
|
||||||
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
|
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ use lancedb::query::{
|
|||||||
};
|
};
|
||||||
use lancedb::table::AnyQuery;
|
use lancedb::table::AnyQuery;
|
||||||
use pyo3::prelude::{PyAnyMethods, PyDictMethods};
|
use pyo3::prelude::{PyAnyMethods, PyDictMethods};
|
||||||
use pyo3::pyfunction;
|
|
||||||
use pyo3::pymethods;
|
use pyo3::pymethods;
|
||||||
use pyo3::types::PyList;
|
use pyo3::types::PyList;
|
||||||
use pyo3::types::{PyDict, PyString};
|
use pyo3::types::{PyDict, PyString};
|
||||||
@@ -983,15 +982,3 @@ impl HybridQuery {
|
|||||||
req
|
req
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert a Python FTS query to JSON string
|
|
||||||
#[pyfunction]
|
|
||||||
pub fn fts_query_to_json(query_obj: &Bound<'_, PyAny>) -> PyResult<String> {
|
|
||||||
let wrapped: PyLanceDB<FtsQuery> = query_obj.extract()?;
|
|
||||||
lancedb::table::datafusion::udtf::fts::to_json(&wrapped.0).map_err(|e| {
|
|
||||||
PyErr::new::<pyo3::exceptions::PyValueError, _>(format!(
|
|
||||||
"Failed to serialize FTS query to JSON: {}",
|
|
||||||
e
|
|
||||||
))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -667,12 +667,6 @@ pub struct QueryRequest {
|
|||||||
|
|
||||||
/// Configure how query results are normalized when doing hybrid search
|
/// Configure how query results are normalized when doing hybrid search
|
||||||
pub norm: Option<NormalizeMethod>,
|
pub norm: Option<NormalizeMethod>,
|
||||||
|
|
||||||
/// If set to true, disables automatic projection of scoring columns (_score, _distance).
|
|
||||||
/// When disabled, these columns are only included if explicitly requested in the projection.
|
|
||||||
///
|
|
||||||
/// By default, this is false (scoring columns are auto-projected for backward compatibility).
|
|
||||||
pub disable_scoring_autoprojection: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for QueryRequest {
|
impl Default for QueryRequest {
|
||||||
@@ -688,7 +682,6 @@ impl Default for QueryRequest {
|
|||||||
prefilter: true,
|
prefilter: true,
|
||||||
reranker: None,
|
reranker: None,
|
||||||
norm: None,
|
norm: None,
|
||||||
disable_scoring_autoprojection: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2391,10 +2391,6 @@ impl BaseTable for NativeTable {
|
|||||||
scanner.distance_metric(distance_type.into());
|
scanner.distance_metric(distance_type.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
if query.base.disable_scoring_autoprojection {
|
|
||||||
scanner.disable_scoring_autoprojection();
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(scanner.create_plan().await?)
|
Ok(scanner.create_plan().await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
||||||
|
|
||||||
//! This module contains adapters to allow LanceDB tables to be used as DataFusion table providers.
|
//! This module contains adapters to allow LanceDB tables to be used as DataFusion table providers.
|
||||||
|
|
||||||
pub mod udtf;
|
|
||||||
|
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
use arrow_array::RecordBatch;
|
use arrow_array::RecordBatch;
|
||||||
@@ -24,8 +21,6 @@ use crate::{
|
|||||||
query::{QueryExecutionOptions, QueryFilter, QueryRequest, Select},
|
query::{QueryExecutionOptions, QueryFilter, QueryRequest, Select},
|
||||||
Result,
|
Result,
|
||||||
};
|
};
|
||||||
use arrow_schema::{DataType, Field};
|
|
||||||
use lance_index::scalar::FullTextSearchQuery;
|
|
||||||
|
|
||||||
/// Datafusion attempts to maintain batch metadata
|
/// Datafusion attempts to maintain batch metadata
|
||||||
///
|
///
|
||||||
@@ -140,38 +135,19 @@ impl ExecutionPlan for MetadataEraserExec {
|
|||||||
pub struct BaseTableAdapter {
|
pub struct BaseTableAdapter {
|
||||||
table: Arc<dyn BaseTable>,
|
table: Arc<dyn BaseTable>,
|
||||||
schema: Arc<ArrowSchema>,
|
schema: Arc<ArrowSchema>,
|
||||||
fts_query: Option<FullTextSearchQuery>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BaseTableAdapter {
|
impl BaseTableAdapter {
|
||||||
pub async fn try_new(table: Arc<dyn BaseTable>) -> Result<Self> {
|
pub async fn try_new(table: Arc<dyn BaseTable>) -> Result<Self> {
|
||||||
let schema = table
|
let schema = Arc::new(
|
||||||
.schema()
|
table
|
||||||
.await?
|
.schema()
|
||||||
.as_ref()
|
.await?
|
||||||
.clone()
|
.as_ref()
|
||||||
.with_metadata(HashMap::default());
|
.clone()
|
||||||
|
.with_metadata(HashMap::default()),
|
||||||
Ok(Self {
|
);
|
||||||
table,
|
Ok(Self { table, schema })
|
||||||
schema: Arc::new(schema),
|
|
||||||
fts_query: None,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a new adapter with an FTS query applied.
|
|
||||||
pub fn with_fts_query(&self, fts_query: FullTextSearchQuery) -> Self {
|
|
||||||
// Add _score column to the schema
|
|
||||||
let score_field = Field::new("_score", DataType::Float32, true);
|
|
||||||
let mut fields = self.schema.fields().to_vec();
|
|
||||||
fields.push(Arc::new(score_field));
|
|
||||||
let schema = Arc::new(ArrowSchema::new(fields));
|
|
||||||
|
|
||||||
Self {
|
|
||||||
table: self.table.clone(),
|
|
||||||
schema,
|
|
||||||
fts_query: Some(fts_query),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,15 +172,7 @@ impl TableProvider for BaseTableAdapter {
|
|||||||
filters: &[Expr],
|
filters: &[Expr],
|
||||||
limit: Option<usize>,
|
limit: Option<usize>,
|
||||||
) -> DataFusionResult<Arc<dyn ExecutionPlan>> {
|
) -> DataFusionResult<Arc<dyn ExecutionPlan>> {
|
||||||
// For FTS queries, disable auto-projection of _score to match DataFusion expectations
|
let mut query = QueryRequest::default();
|
||||||
let disable_scoring = self.fts_query.is_some() && projection.is_some();
|
|
||||||
|
|
||||||
let mut query = QueryRequest {
|
|
||||||
full_text_search: self.fts_query.clone(),
|
|
||||||
disable_scoring_autoprojection: disable_scoring,
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(projection) = projection {
|
if let Some(projection) = projection {
|
||||||
let field_names = projection
|
let field_names = projection
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
||||||
|
|
||||||
//! User-Defined Table Functions (UDTFs) for DataFusion integration
|
|
||||||
|
|
||||||
pub mod fts;
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user