# Site search not working for oneboxed content?

**URL:** https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175
**Category:** Feature
**Created:** [15 ديسمبر 2017، 10:35م UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175 "2017-12-15T22:35:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bts/32/184556_2.png) [@bts](https://meta.discourse.org/u/bts)
#### Post date: [15 ديسمبر 2017، 10:35م UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/1 "2017-12-15T22:35:02Z")

</div>

Got a question from a user on our forum and not sure about the answer. (Feel free to move to either “bug” or “feature” as appropriate!)

It seems that certain oneboxed content does not turn up in search results. The example we got here is an embedded YouTube video. Searching for either the video title or the URL / YouTube video ID turns up no results in Discourse search.

> **[Searching for embedded video links](https://forum.troygrady.com/t/searching-for-embedded-video-links/1635)**
>
> So, when I was making the post linked below, I wanted to check whether the linked video had been posted on the forum before. But neither the youtube url, nor the “video id” component of the url, nor the keyword “mixer” from the video title seemed...

For example, this video below is embedded using `https://www.youtube.com/watch?v=lmFgeFh2nlw`

[![](https://global.discourse-cdn.com/meta/original/4X/b/a/8/ba8a1e32f5eda46898253cc320975f5f2484b472.jpeg "Metallica Mixer Explains Missing Bass on 'And Justice for All'") ](https://www.youtube.com/watch?v=lmFgeFh2nlw)

But no search results come up for either `Metallica Mixer` (part of the title; only shows upon onebox) or the video ID `lmFgeFh2nlw` (from the URL, which text is actually part of the initial post.)

Not sure whether this is by design, or if we should be seeing search results for this sort of thing. But I can see the use case, namely “has anyone posted this link before”, for any forums where such links are common.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [16 ديسمبر 2017، 12:32ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/2 "2017-12-16T00:32:15Z")

</div>

Let’s see.. obscure YouTube video incoming..

[![](https://global.discourse-cdn.com/meta/original/4X/7/0/c/70c0843657568ea162d5a0519aacdd1e48820a73.jpeg "Be a Safe Rider - Elevator and Escalator Safety") ](https://www.youtube.com/watch?v=jutOFp1QOcw)

I’d expect only the URL is findable in search, let’s see:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/0/803b73dabd5745d038432d2e7fe06a366d261a32.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [16 ديسمبر 2017، 12:33ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/3 "2017-12-16T00:33:39Z")

</div>

Oddly enough, nope, can’t find the youtube URL by the unique part of the URL (I can’t type it here without it erroneously triggering search results) cc @sam not sure what user expectations should be here.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16 ديسمبر 2017، 12:37ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/4 "2017-12-16T00:37:06Z")

</div>

I think our cooked post → search data extractor should have special handling to extract HREFs out and add to indexed search data cause you may want to search for them. I think this popped up elsewhere this week as well.

---

<div class="post-metadata">

### Author: ![bts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bts/32/184556_2.png) [@bts](https://meta.discourse.org/u/bts)
#### Post date: [16 ديسمبر 2017، 1:51ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/5 "2017-12-16T01:51:35Z")

</div>

Got it, interesting, thanks for taking a look at this!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [27 ديسمبر 2017، 10:54م UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/6 "2017-12-27T22:54:31Z")

</div>

I am assigning this to me cause it can be implemented quite simply.

We already have the cooked info of:

```plaintext
<div class=\"lazyYT\" data-youtube-id=\"lmFgeFh2nlw\" data-youtube-title=\"Metallica Mixer Explains Missing Bass on 'And Justice for All' [Exclusive]\" data-width=\"480\" data-height=\"270\" data-parameters=\"feature=oembed&amp;wmode=opaque\"></div>

```

Our post indexer operates on cooked/normalized content (not on raw) so we can easily extract title.

So I need to:

1. Confirm we re-index after we resolve oneboxes
2. Add special extraction logic for `data-youtube-title`

Pretty straight forward and helps search!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [26 أبريل 2018، 5:47ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/8 "2018-04-26T05:47:43Z")

</div>

This is fixed per:

[https://github.com/discourse/discourse/commit/6676bbd38b7f17295c4c2bca32bdda2fc98bde47](https://github.com/discourse/discourse/commit/6676bbd38b7f17295c4c2bca32bdda2fc98bde47)

Requires a rebake for titles to appear in search.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [27 أبريل 2018، 8:00ص UTC](https://meta.discourse.org/t/site-search-not-working-for-oneboxed-content/76175/9 "2018-04-27T08:00:09Z")

</div>

This topic was automatically closed after 26 hours. New replies are no longer allowed.
