This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table, | |
formatReadableSize(sum(bytes)) as size, | |
min(min_date) as min_date, | |
max(max_date) as max_date | |
FROM system.parts | |
WHERE active | |
GROUP BY table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
concat( | |
'create table ', | |
table_name, | |
'(', | |
string_agg( | |
concat( | |
column_name, | |
' ', | |
CASE when is_nullable = 'YES' THEN 'Nullable(' END, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DataSearch | |
componentId={id} | |
dataField="original_title" | |
URLParams | |
className="search-container" | |
showIcon={false} | |
autosuggest={true} | |
react={{ and: ["ResultList"] }} | |
iconPosition="right" | |
innerClass={{ input: "search-input", list: "search-list" }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderCustomSuggestions() { | |
return ({ loading, error, data, value, downshiftProps: { isOpen, getItemProps } }) => { | |
if (loading) { | |
return <div>Fetching Suggestions.</div>; | |
} | |
if (error) { | |
return <div>Something went wrong!Error details {JSON.stringify(error)}</div>; | |
} | |
console.log("STATE", this.state.popular_searches); | |
return isOpen && Boolean(value.length) ? ([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getPopularSearches = value => { | |
var headers = new Headers(); | |
//This the DSL query for searching according to given value | |
const data = { | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"bool": { | |
"must": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DataSearch | |
title="DataSearch" | |
dataField={["original_title", "original_title.search"]} | |
onValueChange={value => { | |
console.log("value is: ", value); | |
// make the pop search REST API call here | |
// save the result in the state | |
// use that state inside the `render` prop for DataSearch to show the popular searches alongside the product search results. | |
}} | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
implementation 'com.github.appbaseio:android-searchbox:tag' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchBar.setOnSearchActionListener(new SearchBar.OnSearchActionListener() { | |
@Override | |
public void onSearchStateChanged(boolean enabled) { | |
String state = enabled ? "enabled" : "disabled"; | |
Toast.makeText(getApplicationContext(), "Search bar is " + state, Toast.LENGTH_SHORT).show(); | |
} | |
@Override | |
public void onSearchConfirmed(CharSequence text) { | |
Toast.makeText(getApplicationContext(), "Search query is: " + text, Toast.LENGTH_SHORT).show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.example.searchwidget.SearchBar | |
android:id="@+id/searchBar" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
app:maxSuggestionsCount="10" | |
app:hint="Search Books" | |
app:placeholder="Search" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} |
NewerOlder