meilisearch / firestore-meilisearch

Fulltext search on Firebase with Meilisearch

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limiting fields for import script

rkeppner opened this issue · comments

When I configure the Firestore extension, I can indicate which fields I want to index in Meilisearch. However, the script to import existing documents (firestore-meilisearch) doesn't seem to have this option. When I import the existing documents, all fields seem to be indexed.

What's the best way to import existing documents while only indexing certain fields?

I found one way to do it: set the environment variable MEILISEARCH_FIELDS_TO_INDEX. I'm going to assume this just needs to be added to the documentation and submit a PR for that, as soon as I get around to it.

Hey @rkeppner, the issue seems to be that fieldsToIndex is not added as a CLI flag here:

program
.name('firestore-meilisearch')
.option(
'--non-interactive',
'Parse all input from command line flags instead of prompting the caller.',
false
)

While your PR does create a work-around, it should be fixed by adding fieldsToIndex as a flag.

I opened a PR with the fix.