# Discobot "capybara" search

**URL:** https://meta.discourse.org/t/discobot-capybara-search/112399
**Category:** Bug
**Created:** [3월 23, 2019, 7:59오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399 "2019-03-23T07:59:17Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [3월 23, 2019, 7:59오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/1 "2019-03-23T07:59:18Z")

</div>

I have noticed one user being stuck on discobot tutorial. When I check his discussion with discobot, I have noticed that he did not pass “capybara” step.

Then, I have noticed on Dashboard, that there were searches for “capybara” (with quotes). When I tried to search on discobot topic for “capybara”, I was surprised to see, that it was not found?!  
I would expect that this would work, particularly as users might just copy text from discbot reply.

What is the difference if you use “” on single word search? I would suspect for them to behave the same.

---

<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: [3월 23, 2019, 9:55오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/2 "2019-03-23T09:55:40Z")

</div>

Here on meta, it works both with and without quotes for me – either curly or plain ASCII, and scoped to topic, or whole site.

Try searching for the word `a l b a c o r e` without the spaces (don’t enter that word here, there is only one hit for it on meta, by design). Add quotes, curly quotes, same results.

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [3월 23, 2019, 10:06오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/3 "2019-03-23T10:06:03Z")

</div>

I noticed that it finds the right post in topic, just the extracted text does not include previewed text with “capybara” - and this is why I (and the user) might be confused as that search did not find it)

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/4/949f205ef714dc5d17cdeec0e069fc91f8b9aa02.png)

If I search without quotes:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/2/b26f864e8f5a5470de8fa9e04bcd8f288da66c04.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: [3월 24, 2019, 5:16오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/4 "2019-03-24T05:16:10Z")

</div>

Oh I see you mean the _excerpts_. @sam is there anything we need to do here for curly vs ascii quotes?

---

<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: [3월 24, 2019, 11:25오후 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/5 "2019-03-24T23:25:35Z")

</div>

@tgxworld can have a quick look, highlighting is done by postgres, my guess is that we are not removing `"` before asking the highlighter to do its thing so it is attempting to highlight the word `"capybara"` and not finding it.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [3월 26, 2019, 2:20오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/7 "2019-03-26T02:20:37Z")

</div>

> [@sam](#):
>
> highlighting is done by postgres

Actually…

> <https://github.com/discourse/discourse/blob/71e431de9e15f2bfe95871e05f7735b0df165d89/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6#L17>

Should I look into getting `ts_headline` working?

---

<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: [3월 26, 2019, 4:18오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/8 "2019-03-26T04:18:30Z")

</div>

> [@tgxworld](#):
>
> Should I look into getting `ts_headline` working?

Very extremely low priority, better results is much more important than better excerpt. Also `ts_headline` can not work anyway cause of the things we do with index as far as I remember. We do some word “explosions” like `www.domain.com` becomes `www.domain.com domain.com` in the index so ts\_headline will go all freaky.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [3월 26, 2019, 9:16오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/9 "2019-03-26T09:16:26Z")

</div>

Thanks for the report @Lure 🙂 This was a good one. Fixed in

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

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [3월 26, 2019, 10:21오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/10 "2019-03-26T10:21:45Z")

</div>

Just tested it - it works. Thanks!

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [4월 1, 2019, 10:00오전 UTC](https://meta.discourse.org/t/discobot-capybara-search/112399/11 "2019-04-01T10:00:09Z")

</div>

This topic was automatically closed after 6 days. New replies are no longer allowed.
