#community-help

Changing Facet Value of Indexed Collections

TLDR Roshan wanted to alter the facet value of fields after indexing. Kishore Nallan explained the current limitation, suggested pre-creation of collection before syncing. Faceted search is also encountered an unknown issue, Kishore Nallan advised to raise the issue in Github.

Powered by Struct AI

1

Feb 03, 2022 (23 months ago)
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:05 AM
Hi everyone, how can i change facet value once the collections are indexed? when i run the command provided in readme, it creates schema with facet value false for every fields, i wan to change it to true for some fields?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:05 AM
👋 Hi Roshan. I don't follow you. Do you mean adding a new field as a facet?
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:06 AM
Kishore Nallan I mean i need to change facet value from false to true to some fields
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:06 AM
Got it, as of now, we don't have a way to alter the schema. You have to recreate the collection and index it. But this feature is prioritized so planning to have it soon.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:07 AM
I'm currently using typesense-mongodb cli tool for creating schema and indexing
10:08
Roshan
10:08 AM
How can i enable faceting for some fields
10:08
Roshan
10:08 AM
using cli tool
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:08 AM
You can pre-create the collection before running that tool for syncing.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:08 AM
npx typesense-mongodb \
   --mongo-collection=test \
   --mongo-database=test \
   --typesense-collection=typesense-collection \
   --mongo-url=<mongodb://localhost:27021> \
   --typesense-url=http://localhost:8108 \
   --typesense-api-key=abc

1

10:09
Roshan
10:09 AM
I'm using this command
10:09
Roshan
10:09 AM
You can pre-create the collection before running that tool for syncing How can i do that ? can you share link for this? Kishore Nallan
10:10
Kishore Nallan
10:10 AM
Just create the collection that way before you start the CLI tool (https://github.com/typesense/typesense-mongodb)
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:37 AM
ok I created the collection now I want to connect that collection with mongodb data(collection) Kishore Nallan?
10:37
Roshan
10:37 AM
how can i do that?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:38 AM
Just pass the collection name via the --typesense-collection cli argument.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
11:10 AM
If i create a collection and try to use in cli as arguments, it says collection already created.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:14 AM
Hmm, that should not be the case. Can you please create an issue on the Github repo with the details, we will take a look.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
11:21 AM
ok

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

Understanding Typesense with Java and MongoDB

Vasudev needed help implementing a Java project with Typesense and MongoDB. Kishore Nallan guided them in designing the project, explaining different methods, providing templates, and responding to error issues. At last, Vasudev successfully implemented the project and expressed gratitude.

45
17mo

Updating Collections Strategy and Faceting New Field

Nithin asked about strategies for updating collections and faceting new fields. Kishore Nallan suggested creating another collection, indexing in the background and using aliases to switch live traffic over, and shared details about the upcoming release.

10
34mo

Troubleshooting Search Function with Typesense

Rohan had trouble understanding how search functions in Typesense with email string fields. Kishore Nallan explained the logic of indexing and introduced new features in the 0.22 RC version, advised Rohan to create an issue regarding schema creation errors.

1

6
26mo

Updating Collection Schema and Querying Unspecified Fields in Typesense

Stefan asked about updating a collection schema. Kishore Nallan stated it's not currently possible but suggested automatic schema detection in version 0.20. Rishabh sought a workaround and Jason suggested creating a new collection with a new schema and re-indexing the data. Rishabh also asked about defining custom field IDs which Jason confirmed is not possible with Typesense.

9
34mo

Adding and Storing Object Types in Typesense Collections

Abrar wanted help adding object types to a typesense collection, Sergio suggested flattening the object and Jason provided an approach to flatten objects and informed about upcoming version v0.24.0 with object support.

11
16mo