未执行ReactiveSearch本机自定义查询

尝试按ID进行过滤,但将所有结果都保存在reactsearch本机中

public render(): React.ReactNode {
        return (
            <ReactiveBase
                app='something'

                <View classname='col'>
                    <SelectedFilters/>
                    <ReactiveComponent
                        componentId='filterbox'
                        customQuery={props => ({
                            query: {
                                'bool': {
                                    'should': [{
                                        'ids': {
                                            'type': 'mydoctype','values': ['TK6IRm4BK9UoLvJay0OC','Ra6IRm4BK9UoLvJaykMD'],},}]
                                },}
                        })}
                    />
                </View>
                <ScrollView
                >
                    <View>

                        <ReactiveList
                            componentId='results'
                            dataField='text1'
                            size={7}
                            showResultStats={false}
                            pagination={true}
                            react={{
                                and: 'filterbox',}}
                            onData={res => (

                                <View style={styles.result}>
                                    <ListItem
                                        title={res.title}
                                        description={res.desc}
                                    />
                                </View>

                            )}
                        />
                    </View>
                </ScrollView>

            </ReactiveBase>
        );

想法要与_id字段的ID匹配

myqq519334668 回答:未执行ReactiveSearch本机自定义查询

尝试以下操作(即使用filter代替should):

                <ReactiveComponent
                    componentId='filterbox'
                    customQuery={props => ({
                        query: {
                            'bool': {                          
                                'filter': [{
                                    'ids': {
                                        'type': 'mydoctype','values': ['TK6IRm4BK9UoLvJay0OC','Ra6IRm4BK9UoLvJaykMD'],},}]
                            },}
                    })}
                />
本文链接:https://www.f2er.com/3142970.html

大家都在问