Reactivesearch: Save Query

Created on 3 Apr 2018  路  4Comments  路  Source: appbaseio/reactivesearch

Issue Type:
Help wanted

Platform:
ReactiveSearch for Web

Description:
is it possible to retrieve the current request to be able to save it ?

Reactivesearch version: x.y.z
V2

Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Anything else:

question web

Most helpful comment

The query is only fired if some other component is watching this component. For example if you've a ReactiveList with a react prop, the query would get fired. Can you try this?

<DataSearch ... />

<ReactiveList
    ...
    react={{
        and: 'searchbox'
    }}
/>

All 4 comments

Hey @ymzoughi, you can use onQueryChange prop on a component which gives you the previous and current query. For example:

<DataSearch
   ...
   onQueryChange={(prevQuery, nextQuery) => ...}
/>

Exactly, I used onQueryChange, but this one was never executed

<DataSearch
                      componentId="searchbox"
                      dataField="modele"
                      highlightField="modele"
                      categoryField="properties.modele"
                      placeholder="..."
                      onQueryChange={(prevQuery, nextQuery) => console.log(prevQuery, nextQuery)}
                    />

The query is only fired if some other component is watching this component. For example if you've a ReactiveList with a react prop, the query would get fired. Can you try this?

<DataSearch ... />

<ReactiveList
    ...
    react={{
        and: 'searchbox'
    }}
/>

thank you so much, it works now !!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmce picture dmce  路  3Comments

willopez picture willopez  路  3Comments

metagrover picture metagrover  路  4Comments

vharitonsky picture vharitonsky  路  4Comments

rbeers picture rbeers  路  3Comments