diff --git a/app/sensors/CategorySearch.js b/app/sensors/CategorySearch.js index fdcecb9bf1..ee1a2cd873 100644 --- a/app/sensors/CategorySearch.js +++ b/app/sensors/CategorySearch.js @@ -134,7 +134,7 @@ export default class CategorySearch extends Component { // default query defaultSearchQuery(input) { if (input && input.value) { - const query = []; + let query = []; if (this.fieldType === "string") { query.push({ match_phrase_prefix: { @@ -149,6 +149,13 @@ export default class CategorySearch extends Component { } }); }); + + query = { + bool: { + should: query, + minimum_should_match: 1 + } + } } if (input.category && input.category !== null) { @@ -299,7 +306,7 @@ export default class CategorySearch extends Component { if(this.props.onValueChange) { this.props.onValueChange(obj.value); } - helper.URLParams.update(this.props.componentId, finalVal.value, this.props.URLParam); + helper.URLParams.update(this.props.componentId, finalVal.value, this.props.URLParams); helper.selectedSensor.set(obj, true); this.setState({ currentValue: value @@ -366,7 +373,7 @@ CategorySearch.propTypes = { React.PropTypes.arrayOf(React.PropTypes.string) ]), componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; // Default props value @@ -374,7 +381,7 @@ CategorySearch.defaultProps = { placeholder: "Search", highlight: false, componentStyle: {}, - URLParam: false + URLParams: false }; // context type @@ -393,5 +400,5 @@ CategorySearch.types = { defaultSelected: TYPES.STRING, customQuery: TYPES.FUNCTION, highlight: TYPES.BOOLEAN, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/sensors/DynamicRangeSlider.js b/app/sensors/DynamicRangeSlider.js index aada007f6e..ea7826f906 100644 --- a/app/sensors/DynamicRangeSlider.js +++ b/app/sensors/DynamicRangeSlider.js @@ -301,7 +301,7 @@ export default class DynamicRangeSlider extends Component { if(this.props.onValueChange) { this.props.onValueChange(obj.value); } - helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam); + helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams); helper.selectedSensor.set(obj, true); this.setState({ @@ -394,7 +394,7 @@ DynamicRangeSlider.propTypes = { onValueChange: React.PropTypes.func, interval: React.PropTypes.number, componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; DynamicRangeSlider.defaultProps = { @@ -402,7 +402,7 @@ DynamicRangeSlider.defaultProps = { stepValue: 1, showHistogram: true, componentStyle: {}, - URLParam: false + URLParams: false }; // context type @@ -422,5 +422,5 @@ DynamicRangeSlider.types = { showHistogram: TYPES.BOOLEAN, customQuery: TYPES.FUNCTION, initialLoader: TYPES.OBJECT, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/sensors/NestedList.js b/app/sensors/NestedList.js index fe3d00c0de..62e50f61a1 100644 --- a/app/sensors/NestedList.js +++ b/app/sensors/NestedList.js @@ -313,7 +313,7 @@ export default class NestedList extends Component { if(this.props.onValueChange) { this.props.onValueChange(obj.value); } - helper.URLParams.update(this.props.componentId, value, this.props.URLParam); + helper.URLParams.update(this.props.componentId, value, this.props.URLParams); helper.selectedSensor.set(obj, isExecuteQuery); } @@ -484,7 +484,7 @@ NestedList.propTypes = { react: React.PropTypes.object, onValueChange: React.PropTypes.func, componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; // Default props value @@ -496,7 +496,7 @@ NestedList.defaultProps = { title: null, placeholder: "Search", componentStyle: {}, - URLParam: false + URLParams: false }; // context type @@ -518,5 +518,5 @@ NestedList.types = { defaultSelected: TYPES.ARRAY, customQuery: TYPES.FUNCTION, initialLoader: TYPES.OBJECT, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/sensors/RatingsFilter.js b/app/sensors/RatingsFilter.js index f6acb5075f..9635236ede 100644 --- a/app/sensors/RatingsFilter.js +++ b/app/sensors/RatingsFilter.js @@ -88,7 +88,7 @@ export default class RatingsFilter extends Component { } // pass the selected sensor value with componentId as key, const isExecuteQuery = true; - helper.URLParams.update(this.props.componentId, JSON.stringify(record), this.props.URLParam); + helper.URLParams.update(this.props.componentId, JSON.stringify(record), this.props.URLParams); helper.selectedSensor.set(obj, isExecuteQuery); } @@ -160,14 +160,14 @@ RatingsFilter.propTypes = { customQuery: React.PropTypes.func, onValueChange: React.PropTypes.func, componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; // Default props value RatingsFilter.defaultProps = { title: null, componentStyle: {}, - URLParam: false + URLParams: false }; // context type @@ -183,5 +183,5 @@ RatingsFilter.types = { data: TYPES.OBJECT, defaultSelected: TYPES.OBJECT, customQuery: TYPES.FUNCTION, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/sensors/TagCloud.js b/app/sensors/TagCloud.js index cac5f88954..4c98e4fb21 100644 --- a/app/sensors/TagCloud.js +++ b/app/sensors/TagCloud.js @@ -66,7 +66,7 @@ export default class TagCloud extends Component { key: this.props.componentId, value: this.selectedValue }; - helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam); + helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams); helper.selectedSensor.set(obj, true); } else if (!this.props.multiSelect && this.defaultSelected !== defaultValue) { this.defaultSelected = defaultValue; @@ -91,7 +91,7 @@ export default class TagCloud extends Component { key: this.props.componentId, value: this.selectedValue }; - helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam); + helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams); helper.selectedSensor.set(obj, true); } }, 300); @@ -270,7 +270,7 @@ export default class TagCloud extends Component { key: this.props.componentId, value: this.selectedValue }; - helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam); + helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams); helper.selectedSensor.set(obj, true); } @@ -348,7 +348,7 @@ TagCloud.propTypes = { react: React.PropTypes.object, onValueChange: React.PropTypes.func, componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; TagCloud.defaultProps = { @@ -357,7 +357,7 @@ TagCloud.defaultProps = { size: 100, title: null, componentStyle: {}, - URLParam: false + URLParams: false }; TagCloud.contextTypes = { @@ -376,5 +376,5 @@ TagCloud.types = { initialLoader: TYPES.STRING, defaultSelected: TYPES.STRING, react: TYPES.OBJECT, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/sensors/ToggleList.js b/app/sensors/ToggleList.js index b76ef5daf4..d646f82c8a 100644 --- a/app/sensors/ToggleList.js +++ b/app/sensors/ToggleList.js @@ -50,7 +50,7 @@ export default class ToggleList extends Component { key: props.componentId, value: records }; - helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam); + helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams); helper.selectedSensor.set(obj, true); } } else { @@ -73,7 +73,7 @@ export default class ToggleList extends Component { key: props.componentId, value: records }; - helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam); + helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams); helper.selectedSensor.set(obj, true); } } else { @@ -154,7 +154,7 @@ export default class ToggleList extends Component { } // pass the selected sensor value with componentId as key, const isExecuteQuery = true; - helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam); + helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams); helper.selectedSensor.set(obj, isExecuteQuery); } @@ -228,14 +228,14 @@ ToggleList.propTypes = { customQuery: React.PropTypes.func, onValueChange: React.PropTypes.func, componentStyle: React.PropTypes.object, - URLParam: React.PropTypes.bool + URLParams: React.PropTypes.bool }; // Default props value ToggleList.defaultProps = { multiSelect: true, componentStyle: {}, - URLParam: false + URLParams: false }; // context type @@ -252,5 +252,5 @@ ToggleList.types = { defaultSelected: TYPES.ARRAY, multiSelect: TYPES.BOOLEAN, customQuery: TYPES.FUNCTION, - URLParam: TYPES.BOOLEAN + URLParams: TYPES.BOOLEAN }; diff --git a/app/stories/CategorySearch.stories.js b/app/stories/CategorySearch.stories.js index 0503d9fa77..9e283ada94 100644 --- a/app/stories/CategorySearch.stories.js +++ b/app/stories/CategorySearch.stories.js @@ -64,7 +64,7 @@ export default class CategorySearchDefault extends Component {