Index document in filterable attributes tests

**Reason:**
Because the filterable attributes are patterns now,
the fieldIdMap will only register the fields that exists in at least one document.
if a field doesn't exist in any document, it will not be registered even if it has been specified in the filterable fields.
This commit is contained in:
ManyTheFish 2025-02-27 16:50:50 +01:00
parent 9a75dc6ab3
commit 6dbec91d2b
3 changed files with 35 additions and 14 deletions

View file

@ -3604,22 +3604,28 @@ async fn federation_non_faceted_for_an_index() {
let index = server.index("fruits");
let documents = FRUITS_DOCUMENTS.clone();
let (value, _) = index.add_documents(documents, None).await;
index.wait_task(value.uid()).await.succeeded();
let (value, _) = index
.update_settings(
json!({"searchableAttributes": ["name"], "filterableAttributes": ["BOOST", "id", "name"]}),
)
.await;
index.wait_task(value.uid()).await.succeeded();
let index = server.index("fruits-no-name");
let documents = FRUITS_DOCUMENTS.clone();
let (value, _) = index.add_documents(documents, None).await;
index.wait_task(value.uid()).await.succeeded();
let (value, _) = index
.update_settings(
json!({"searchableAttributes": ["name"], "filterableAttributes": ["BOOST", "id"]}),
)
.await;
index.wait_task(value.uid()).await.succeeded();
let index = server.index("fruits-no-facets");