ReactiveComponent type
Affected Projects React
Library Version: x.y.z 4.0.0-rc.10
Describe the bug The React Component returns the empty value matches with the default value of type: "term", if I change it to "search" by postman it returns the expected result. Is there a way to change this?
To Reproduce
POST http://localhost:8000/catalogodev/_reactivesearch
{
"settings": {
"recordAnalytics": true,
"enableQueryRules": true,
"emptyQuery": true,
"suggestionAnalytics": true
},
"query": [
{
"id": "products",
"type": "term",
"dataField": [
"reactive_component_field"
],
"execute": true,
"react": {
"and": "products__internal"
},
"defaultQuery": {
"query": {
# query
}
]
}
Expected behavior
{
"settings": {
"recordAnalytics": true,
"enableQueryRules": true,
"emptyQuery": true,
"suggestionAnalytics": true
},
"query": [
{
"id": "products",
"type": "search",
"dataField": [
"reactive_component_field"
],
"execute": true,
"react": {
"and": "products__internal"
},
"defaultQuery": {
# query
}
]
}
What Reactivesearch component are you using?
@jorgeju4rez I see you are using ReactiveComponent, The ReactiveComponent is designed with a predefined query type - 'term' and doesn't have the option to change it.
However, the query manipulation might be possible using the transformRequest prop in the ReactiveBase wrapper component.
Refer here -> https://docs.reactivesearch.io/docs/reactivesearch/react/v3/overview/reactivebase/#transformrequest