question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Results with filtered children?

See original GitHub issue

Hi, So if we have an array of objects and search for them, Fuse returns the objects that match the criteria. But if said objects have an array of children which we want to search, is it possible to filter those to the search criteria as well?

Examples:

[
	{
		label: 'parent123',
	},
	{
		label: 'parent321',
	}.
]

If we search for parent123 we will get:

[
	{
		label: 'parent123',
	}
]

But if it’s a group with children:

[
	{
		label: 'parent123',
		children: [
			{
				label: 'child1'
			},
			{
				label: 'child2'
			},
			{
				label: 'child3'
			},
		]
	},
...

Is it possible for a search of parent123 to return back that object (as usual) but for a search of child2 to get back:

[
	{
		label: 'parent123',
		children: [
			{
				label: 'child2'
			},
		]
	}
]

? 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:7

github_iconTop GitHub Comments

1reaction
ashusdncommented, Aug 30, 2017

Hi ,

I also want same behavior in my project. My array as below

var test= [ { “title”: “Floor A”, “id”: “55fea689216b519578bc1b3a”, “units”: [ { “unitTitle”: “A.0.1”, “unitID”: “55fea689216b519578bc1b6e” }, { “unitTitle”: “A.0.2 - EG”, “unitID”: “55fea689216b519578bc1b6f” } ] }, { “title”: “Floor B”, “id”: “55fea689216b519578bc1b3b”, “units”: [ { “unitTitle”: “B.0.1”, “unitID”: “55fea689216b519578bc1b98” }, { “unitTitle”: “B.0.2 - EG”, “unitID”: “55fea689216b519578bc1b99”, }, ] } ]

suppose I want to search “Floor” then it should return all the record that matches with it. If I search “B.0.2” then my expected result will be:

{ “unitTitle”: “B.0.2 - EG”, “unitID”: “55fea689216b519578bc1b99”, }

But I get the result as mentioned below:

{ “title”: “Floor B”, “id”: “55fea689216b519578bc1b3b”, “units”: [ { “unitTitle”: “B.0.1”, “unitID”: “55fea689216b519578bc1b98” }, { “unitTitle”: “B.0.2 - EG”, “unitID”: “55fea689216b519578bc1b99”, }, ] }

can you please provide any solution for it. I am waiting for your response.

0reactions
github-actions[bot]commented, Mar 29, 2020

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filter explicit results using SafeSearch - Android
Whether you use Google Search at work, with children, or for yourself, SafeSearch can help you filter explicit content from your results.
Read more >
Option to include Children rows in Filtered results
When conducting reviews, I filter the list of initiatives based the stakeholders I am meeting with. Most often, the Children of row item ......
Read more >
Solved: Security filters Children records
It's strange , because unfiltered children loads much faster then filtered children ( altough unfiltered means about 30 times more data). Also, for...
Read more >
how to display the result for child filter on click of parent filter
I wanna display the result of the next filter on click of parent filter and so on...
Read more >
Reading disabilities and the effects of colored filters
The efficacy of a controversial treatment, using colored filters to remediate reading disabilities, was measured empirically, with colored overlays placed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found