#community-help

Difficulty in Searching Schema Returns No Results

TLDR Robert cannot search anything in a schema they have defined and populated with data. Kishore Nallan asks for a reproducible example.

Powered by Struct AI
Aug 24, 2021 (27 months ago)
Robert
Photo of md5-a0aba3e46685345ae57c342a8130989f
Robert
12:01 PM
Hi there. We defined a schema like this:
{
  name: 'collections',
  fields: [
    {
      name: 'collection_name',
      type: 'string[]',
      facet: true,
    },
    {
      name: 'id',
      type: 'string',
      facet: false,
    },
  ],
}

I’ve populated it with data.
And when i try to search anything like:
{
  q: 'a',
  query_by: 'collection_name',
  num_typos: 0,
}

or any other letter, i get no results. Do you have any idea why?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:11 PM
id is a special field so should not be part of schema. In the next version we have added some guard for this.
Robert
Photo of md5-a0aba3e46685345ae57c342a8130989f
Robert
12:20 PM
Ok, but thats not the problem we have. Id is not the problem. If we transform the field from string[] to string, everything works as intended.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:45 PM
Can you please post a minimal reproduceable example? Does it happen even with a couple of simple records?
03:04
Kishore Nallan
03:04 PM
Just tried with a simple example and it works for me. If you can give me a full reproduceable example, I will be happy to dig into it.