Reducing number of objects

Hey :slight_smile: i wanted to know if it was possible to do things like this :
For example in my database i have :

  1. brand : Apple category : Iphone
    2)brand : Apple category : Mac
    3)brand : Apple category : macbook
    4brand : Samsung category : Galaxie
    But instead of 4 objects i would like 2, the branch could have many categories.And when i do my search it’s like : Apple
    category : mac …
    Iphone …
    Macbook …
    Is-that Possible ?

If anyone have ideas or solutions :slight_smile: Thank you.

Thanks for reaching out!

I just want to make sure I understand your question, so I’d like to ask you if you can give an example of what the search is, and what is the expected outcome that you’d like?

Best,

That’s my current objects ( 3 objects):

1 ) title : Number of students ; Period : 2016 ; number : 500 ; girls : 400
2 ) title : Number of students ; Period : 2017 ; number : 600 ; girls : 500
3 ) title : Number of students ; Period : 2018 ; number : 700 ; girls : 600
And i would like this resume like that :

        1 ) title : Number of students (1 object)
               Period : 2016 ; number : 500 ; girls : 400
              Period : 2017 ; number : 600 ; girls : 500
              Period : 2018 ; number : 700 ; girls : 600

Is that more clear? Thanks

If I understand correctly, you would like to index your objects with an array of values.
If so, you can do that with Algolia (see here https://www.algolia.com/doc/guides/indexing/structuring-your-data/#indexing-relations).

Let us know if that helps!

1 Like

Thank you :slight_smile: , but like in the example :

{
“book_name”: “Harry Potter and the Philosopher’s Stone”,
“popularity”: 1000
},
{
“book_of”: “Harry Potter and the Philosopher’s Stone”,
“chapter_name”: “The Boy Who Lived”,
“popularity”: 900
},
{
“book_of”: “Harry Potter and the Philosopher’s Stone”,
“chapter_name”: “The Vanishing Glass”,
“popularity”: 800
}

And if a search "Harry Potter and […] what’s going to happen?

If your ranking formula is the one by default, the 3 records will be returned!

Let us know if you have any questions!