# SearchByType fails when node type contains a space

**URL:** <https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449>\
**Category:** General\
**Created:** [21 July 2022 23:24 UTC](https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449 "2022-07-21T23:24:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![annuello](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/annuello/32/62361_2.png) [@annuello](https://discourse.nodered.org/u/annuello)\
**Post date:** [21 July 2022 23:24 UTC](https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449/1 "2022-07-21T23:24:41Z")

</div>

I've noticed in both v2.x and v3.0.0 that searching for all instances of a node give varying results. Turns out the search-by-type doesn't find nodes if the node type contains spaces.

Step 1

 ![Instance search](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d9ad6677c0dff1a04dfffa076cab2d90fa1ec33f.png)

Step 2 (which fails to find nodes if the name contains a space)

 ![SearchByType](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b545252f4599db05c35301d5fee6bfffb3e67d0.png)

Step 3 - Removing _type:_ form the search phrase will find all instances, though it would be nice if spaces were supported in the _type:_ search param.

 ![SearchGeneric](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3a3a11019fd1aab8633f8477d3619b101958874c.png)

Yours,  
Annuello.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 July 2022 06:11 UTC](https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449/2 "2022-07-22T06:11:54Z")

</div>

Hi. would you be kind enough to raise an issue on the node-red githib repository so this doesn't get missed?

Thanks

---

<div class="post-metadata">

**Author:** ![annuello](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/annuello/32/62361_2.png) [@annuello](https://discourse.nodered.org/u/annuello)\
**Post date:** [22 July 2022 07:26 UTC](https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449/3 "2022-07-22T07:26:33Z")

</div>

Issue raised.

> <https://github.com/node-red/node-red/issues/3796#issue-1314516594>
>
> \### Current Behavior
> 
> Node types which have a space in the name do not appear in… results for SearchByType.
> 
> \### Expected Behavior
> 
> SearchByType should find/list nodes with matching search term, regardless of space in the node name.
> 
> \### Steps To Reproduce
> 
> 1 - From the Library on the left drag an instance of a node to a flow, where the node name contains a space. E.g. "http request". Deploy the flow to instantiate the node.
> 2 - In the Library on the left, hover over a node whose name contains a space. E.g. The "http request" Library node.
> 3 - When the popup appears with description, documentation mini-icon, search mini-icon, etc click on the search icon to auto-fill the search phrase. Search phrase will be populated with the node name, prepended by a type filter. E.g. "type: http request"
> 4 - Note that no instances appear in the search results.
> 
> (The above method will successfully find nodes when the node name does not contain spaces.)
> 
> 
> \### Example flow
> 
> \`\`\`
> paste your flow here
> \`\`\`
> 
> 
> \### Environment
> 
> Occurs in various versions. All running on RPi via install approach recommended on nodered.org.
> Environment 1
> \- Node-RED version: v2.1.14 (also observed on newer v2.x.x. version environments)
> \- Node.js version: v14.18.2
> \- npm version: v6.14.15
> \- Platform/OS: Debian Buster
> \- Browser: Safari, FireFox
> 
> Environment 2
> \- Node-RED version: v3.0.0
> \- Node.js version: v14.19.3
> \- npm version: v6.14.17
> \- Platform/OS: Debian Buster
> \- Browser: Safari, FireFox

Annuello.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 September 2022 07:27 UTC](https://discourse.nodered.org/t/searchbytype-fails-when-node-type-contains-a-space/65449/4 "2022-09-20T07:27:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
