Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If there a way to prevent searching when querystring is empty? #54

Open
mingfang opened this issue Oct 1, 2015 · 2 comments
Open

If there a way to prevent searching when querystring is empty? #54

mingfang opened this issue Oct 1, 2015 · 2 comments

Comments

@mingfang
Copy link

mingfang commented Oct 1, 2015

This is my search input

  <input placeholder="Search" type="text" eui-query="ejs.MatchQuery('line', querystring)" ng-model="querystring" eui-enabled="querystring.length" />

This work during startup since eui-enabled will be false.
However, after doing a search and then subsequently clearing the search input, the result is another search using an empty query.

My workaround is to surround the result display with this

    <div ng-if="indexVM.query">
      <ul>
          <li ng-repeat="doc in indexVM.results.hits.hits">
...
          </li>
      </ul>
    </div>

Ideally I want to avoid the search completely.

@YousefED
Copy link
Owner

YousefED commented Oct 1, 2015

I don't think this is currently supported. You might be able to unset (null / empty) indexVM.index to accomplish what you want, but this would also be kind of a workaround

@mingfang
Copy link
Author

mingfang commented Oct 1, 2015

#40 seems to be a solution but that PR has been stuck there since May.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants