Skip to content

Commit

Permalink
remove sparse vector tests as these break the existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Samiul-TheSoccerFan committed Sep 20, 2024
1 parent a9a3c21 commit d18cdf5
Showing 1 changed file with 0 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ setup:
bigint:
type: keyword


- do:
index:
index: test_1
Expand Down Expand Up @@ -187,163 +186,3 @@ setup:
# When this test is run during runtime-field's tests we *don't* get floating point errors. Thus the funny assertion here that matches both.
- lt: { hits.hits.0.fields.d.0: 3.141 }
- gte: { hits.hits.0.fields.d.0: 3.14 }

---
"Include sparse embeddings in _source by default":
- requires:
cluster_features: "gte_v8.16.0"
reason: _source filtering for sparse vector added in 8.16.0
- do:
indices.create:
index: test
body:
mappings:
properties:
text:
type: text
ml.tokens:
type: sparse_vector

- do:
index:
index: test
id: "1"
body:
text: "running is good for you"
ml:
tokens:
- running: 2.4097164
good: 2.170997
run: 2.052153
race: 0.1
for: 1.1908325
runner: 1.1803857
exercise: 0.1
you: 0.9654308
training: 0.94999343
sports: 0.93650943
fitness: 0.83129317
best: 0.820365
bad: 0.1
health: 0.1
marathon: 0.61555296
gym: 0.5652374

- do:
search:
index: test
body:
query:
sparse_vector:
field: "ml.tokens"
query_vector: {"exercise": 0.1 }

- exists: { hits.hits.0._source.ml.tokens }

---
"Exclude sparse embeddings from _source":
- requires:
cluster_features: "gte_v8.16.0"
reason: _source filtering for sparse vector added in 8.16.0
- do:
indices.create:
index: test
body:
mappings:
properties:
text:
type: text
ml.tokens:
type: sparse_vector

- do:
index:
index: test
id: "1"
body:
text: "running is good for you"
ml:
tokens:
- running: 2.4097164
good: 2.170997
run: 2.052153
race: 0.1
for: 1.1908325
runner: 1.1803857
exercise: 0.1
you: 0.9654308
training: 0.94999343
sports: 0.93650943
fitness: 0.83129317
best: 0.820365
bad: 0.1
health: 0.1
marathon: 0.61555296
gym: 0.5652374

- do:
search:
index: test
body:
_source:
include_vectors: false
query:
sparse_vector:
field: "ml.tokens"
query_vector: {"exercise": 0.1 }

- not_exists: { hits.hits.0._source.ml.tokens }

---
"Exclude sparse embeddings from _source":
- requires:
cluster_features: "gte_v8.16.0"
reason: _source filtering for sparse vector added in 8.16.0
- do:
indices.create:
index: test
body:
mappings:
properties:
text:
type: text
ml.tokens:
type: sparse_vector

- do:
index:
index: test
id: "1"
body:
text: "running is good for you"
ml:
tokens:
- running: 2.4097164
good: 2.170997
run: 2.052153
race: 0.1
for: 1.1908325
runner: 1.1803857
exercise: 0.1
you: 0.9654308
training: 0.94999343
sports: 0.93650943
fitness: 0.83129317
best: 0.820365
bad: 0.1
health: 0.1
marathon: 0.61555296
gym: 0.5652374

- do:
search:
index: test
body:
_source:
include_vectors: true
query:
sparse_vector:
field: "ml.tokens"
query_vector: {"exercise": 0.1 }

- exists: { hits.hits.0._source.ml.tokens }

0 comments on commit d18cdf5

Please sign in to comment.