# Expandable advanced search UI panel

**URL:** https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440
**Category:** Feature
**Tags:** feedback
**Created:** [2016年八月10日 07:05 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440 "2016-08-10T07:05:04Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2016年十月4日 15:39 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/23 "2016-10-04T15:39:48Z")

</div>

> [@cpradio](#):
>
> it seems using a-zA-Z ranges are not necessary unicode safe

AFAIK that would be OK for typical “English” letters.

I don’t know for certain if POSIX regex considers \w the same as PHP PCRE - i.e. “word” characters are based on locale - but I believe it does and I think that would be safer if you’re using a character class

---

<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: [2016年十月10日 23:48 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/24 "2016-10-10T23:48:13Z")

</div>

This is now merged in and available for testing on meta!

Big thank you to @cpradio!!!

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2016年十月11日 03:00 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/25 "2016-10-11T03:00:19Z")

</div>

Feature suggestion: this (amazing, by the way) new UI is not accessible from search until you enter full-screen search. That means if I am sitting here in this topic and click search, I don’t see the UI. If I click options, I get the old text based popup.

Could the “options” button redirect you the full-screen search, or add a button that does that? At the moment I have to actually type something and click enter to reach full-screen search (or right search and open in new tab). Not intuitive or accessible.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月11日 03:08 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/26 "2016-10-11T03:08:30Z")

</div>

I think the next step is to build auto-complete ability into the existing search so it can help populate the advanced search features. Whether that helps with intituitiveness, I’m not sure, but I believe that is the next up-coming step.

Granted, changing “options” to “advanced” and linking it to the full page search, may be something worthwhile now, since the UI now exists.

---

<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: [2016年十月11日 21:08 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/27 "2016-10-11T21:08:40Z")

</div>

> [@cpradio](#):
>
> Granted, changing “options” to “advanced” and linking it to the full page search, may be something worthwhile now, since the UI now exists.

Yes, I agree – clicking “options” should **trigger full page search with the Advanced panel pre-expanded**. I’ve removed all the old search help copy entirely to expedite this.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月11日 21:32 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/28 "2016-10-11T21:32:59Z")

</div>

> [@codinghorror](#):
>
> Yes, I agree – clicking “options” should trigger full page search with the Advanced panel pre-expanded. I’ve removed all the old search help copy entirely to expedite this.

I’m going to throw this on my plate for this week in my spare time (hoping I get to it tonight)

---

<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: [2016年十月11日 21:34 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/29 "2016-10-11T21:34:29Z")

</div>

One minor tweak. When filling in the user and populating the search field, don’t use

`user:username`

but instead

`@username`

---

<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: [2016年十月11日 21:35 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/30 "2016-10-11T21:35:26Z")

</div>

That old search help copy was a nightmare to localize and maintain, it will be really nice to get rid of it all.

---

<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: [2016年十月11日 21:35 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/31 "2016-10-11T21:35:49Z")

</div>

Yes this is a case study in “better UI” replacing “bad help pages”.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月11日 21:36 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/32 "2016-10-11T21:36:21Z")

</div>

K, will work that in tonight too. 🙂

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月11日 21:52 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/33 "2016-10-11T21:52:34Z")

</div>

> [@codinghorror](#):
>
> One minor tweak. When filling in the user and populating the search field, don’t use
> 
> `user:username`
> 
> but instead
> 
> `@username`

This is done. I also updated the qunit tests so they stopped failing due to the removed markup from

> [@Advanced Search UI](https://meta.discourse.org/t/advanced-search-ui/51426/3):
>
> Just a note, I find “in Group” and “with Badge” to be so hyper-specialized I’ve commented them out in the HTML markup for now.

🙂

[https://github.com/discourse/discourse/pull/4489](https://github.com/discourse/discourse/pull/4489)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月12日 00:14 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/34 "2016-10-12T00:14:51Z")

</div>

> [@codinghorror](#):
>
> > [@cpradio](#):
> >
> > Granted, changing “options” to “advanced” and linking it to the full page search, may be something worthwhile now, since the UI now exists.
> 
> Yes, I agree – clicking “options” should **trigger full page search with the Advanced panel pre-expanded**. I’ve removed all the old search help copy entirely to expedite this.

PR Submitted  
[https://github.com/discourse/discourse/pull/4490](https://github.com/discourse/discourse/pull/4490)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月12日 00:36 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/35 "2016-10-12T00:36:43Z")

</div>

> [@codinghorror](#):
>
> I’ve removed all the old search help copy entirely to expedite this.

Seems the removal of the old search help broke the build by making eslint unhappy. I’ve fixed it (just waiting on build to run to verify it is fixed).  
[https://github.com/discourse/discourse/pull/4491](https://github.com/discourse/discourse/pull/4491)

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [2016年十月12日 18:57 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/36 "2016-10-12T18:57:08Z")

</div>

Any chance this could also give an option for number of results returned? Still getting killed by MAX 50 results issue #WishFullThinking

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2016年十月13日 14:06 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/37 "2016-10-13T14:06:32Z")

</div>

Cool, this looks good. Two questions:

- should the label be “advanced search” now, instead of “options”?
- I liked the Google search form in the previous help message, it would be nice to keep it as a link at the bottom of the advanced search screen, any intereset in keeping 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: [2016年十月13日 14:11 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/38 "2016-10-13T14:11:13Z")

</div>

Some 🐛s/UX issues

1. The default for “In Category” is “uncategorized” but it doesn’t actually search for “uncategorized” categories but all categories.

2. “Posted” before/after should use a date picker and we can expand that to support “in between” searches.

3. ‘With Tags’ input field is much longer than other input fields.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月13日 14:23 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/39 "2016-10-13T14:23:46Z")

</div>

> [@tgxworld](#):
>
> ‘With Tags’ input field is much longer than other input fields

That is intentional (hence why it is on its own line), as it can support multiple entries.

> [@tgxworld](#):
>
> “Posted” before/after should use a date picker and we can expand that to support “in between” searches.

You will lose the ability to search for before X days or after X days if you use a date-picker. Since the feature supports both, I elected to leave it a text field.

> [@tgxworld](#):
>
> The default for “In Category” is “uncategorized” but it doesn’t actually search for “uncategorized” categories but all categories.

Yeah, the category-chooser defaults to that… ☹ Has for ages, there are multiple topics about it here on Meta because it impacts Admins when Uncategorized is disabled. (but it seems setting it to Null, solved this?)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月13日 14:37 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/40 "2016-10-13T14:37:06Z")

</div>

> [@cpradio](#):
>
> (but it seems setting it to Null, solved this?)

It isn’t. So the uncategorized also only applies to instances that permit uncategorized topics. It seems to be due to the fact Uncategorized is treated in a special manner, which is the same reason you can’t default a New Topic off of Latest to “Select a Category”, that option doesn’t exist when Uncategorized is present. ☹

---

<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: [2016年十月13日 15:42 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/41 "2016-10-13T15:42:30Z")

</div>

> [@cpradio](#):
>
> That is intentional (hence why it is on its own line), as it can support multiple entries.

`tag-chooser` has a variable height so we don’t really need it to be that long 🙂

 ![](https://global.discourse-cdn.com/meta/original/3X/b/0/b038dbc959a0d7ea94275636f3a0bad0a48a2320.png)

> [@cpradio](#):
>
> You will lose the ability to search for before X days or after X days if you use a date-picker. Since the feature supports both, I elected to leave it a text field.

I’ve actually never known about the `before:` and `after:` advanced search terms until today and it wasn’t easy for me to determine how to use it from the search UI. The format of the date required is a mystery as well. I think we should just drop support for `before:5` in the search UI and just use a date picker since selecting 7 days ago in a date picker isn’t difficult.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月13日 16:39 UTC](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440/42 "2016-10-13T16:39:24Z")

</div>

> [@tgxworld](#):
>
> I’ve actually never known about the before: and after: advanced search terms until today and it wasn’t easy for me to determine how to use it from the search UI. The format of the date required is a mystery as well. I think we should just drop support for before:5 in the search UI and just use a date picker since selecting 7 days ago in a date picker isn’t difficult.

That’s fair. I’ll switch it to use type=“date” here shortly. That should get it operational.

> [@tgxworld](#):
>
> tag-chooser has a variable height so we don’t really need it to be that long 🙂

So should I add a width of 70%? I really don’t want to end up with a squashed tag selector on mobile.

Also, I just pushed a change to fix removing the filters via the search-term text field.

[上一頁](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440.md?page=1)

[下一頁](https://meta.discourse.org/t/expandable-advanced-search-ui-panel/48440.md?page=3)
