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

ReactiveComponent type #2213

Open
jorgeju4rez opened this issue Apr 26, 2023 · 2 comments
Open

ReactiveComponent type #2213

jorgeju4rez opened this issue Apr 26, 2023 · 2 comments
Labels

Comments

@jorgeju4rez
Copy link

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
    }
  ]
}
@SavvyShah
Copy link
Contributor

What Reactivesearch component are you using?

@mohdashraf010897
Copy link
Member

@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

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

No branches or pull requests

3 participants