Skip to content

Commit

Permalink
fix(web): prefer query string over search operators
Browse files Browse the repository at this point in the history
  • Loading branch information
bietkul committed Jul 8, 2020
1 parent 8299936 commit d099ad6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/web/src/components/search/CategorySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ class CategorySearch extends Component {
} else {
fields = [props.dataField];
}
if (props.searchOperators) {

if (props.queryString) {
finalQuery = {
simple_query_string: CategorySearch.shouldQuery(value, fields, props),
query_string: CategorySearch.shouldQuery(value, fields, props),
};
} else if (props.queryString) {
} else if (props.searchOperators) {
finalQuery = {
query_string: CategorySearch.shouldQuery(value, fields, props),
simple_query_string: CategorySearch.shouldQuery(value, fields, props),
};
} else {
finalQuery = {
Expand Down
8 changes: 4 additions & 4 deletions packages/web/src/components/search/DataSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ class DataSearch extends Component {
fields = [props.dataField];
}

if (props.searchOperators) {
if (props.queryString) {
finalQuery = {
simple_query_string: DataSearch.shouldQuery(value, fields, props),
query_string: DataSearch.shouldQuery(value, fields, props),
};
} else if (props.queryString) {
} else if (props.searchOperators) {
finalQuery = {
query_string: DataSearch.shouldQuery(value, fields, props),
simple_query_string: DataSearch.shouldQuery(value, fields, props),
};
} else {
finalQuery = {
Expand Down

0 comments on commit d099ad6

Please sign in to comment.