Skip to content

Instantly share code, notes, and snippets.

View mohdashraf010897's full-sized avatar
✌️
Collaborating

Mohd Ashraf mohdashraf010897

✌️
Collaborating
View GitHub Profile
var Crypto = Class.create();
Crypto.prototype = {
initialize: function() {
/**
* CryptoJS core components.
*/
var CryptoJS = CryptoJS || (function (Math, undefined) {
/**
* CryptoJS namespace.
@mohdashraf010897
mohdashraf010897 / create_script_rule.js
Last active February 23, 2022 15:43
Creates a query rule with script action to perform sentiment analysis
curl 'https://appbase-demo-ansible-abxiydt-arc.searchbase.io/_rule' \
-H 'authority: appbase-demo-ansible-abxiydt-arc.searchbase.io' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \
-H 'authorization: Basic YjdHTHJLeHNkOjA5NWUyZWFiLTM4MDAtNDkxYi1hYmY2LTZiMTVjZjhlZGY4Nw==' \
-H 'x-search-client: Appbase Dashboard' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'content-type: application/json' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'accept: */*' \
<SearchBox
componentId="search-box"
iconPosition="right"
:dataField="[
'original_title',
'original_title.search',
'authors.search',
'authors.raw',
'authors.autosuggest',
'authors',
<ReactiveBase
app="good-books-ds"
url="https://6a0ae3a3a8d4:6a3f508d-169b-4ed7-9680-20658120930f@appbase-demo-ansible-abxiydt-arc.searchbase.io"
:enableAppbase="true"
>
<h1>Hello from ReactiveBase 👋</h1>
</ReactiveBase>
<MultiList
componentId="Authors"
dataField="authors.keyword"
class="filter"
title="Select Authors"
selectAllLabel="All Authors"
:react="{ and: ['Ratings', 'search-box'] }"
/>
<ReactiveList
componentId="SearchResult"
data-field="original_title.raw"
:pagination="true"
:from="0"
:size="8"
:showResultStats="true"
:react="{ and: ['Ratings', 'Authors', 'search-box'] }"
:innerClass="{ list: 'books-container', poweredBy: 'appbase' }"
>
body {
margin: 0;
background: #f7f7f7;
}
.filter input {
height: unset;
}
.navbar {
<SearchBox
componentId="mainSearch"
dataField={["original_title", "original_title.search"]}
categoryField="genres.keyword"
className="search-bar"
queryFormat="and"
placeholder="Search for movies..."
iconPosition="left"
autosuggest={true}
filterLabel="search"
<ReactiveBase
app="movies-demo-app"
url="https://81719ecd9552:e06db001-a6d8-4cc2-bc43-9c15b1c0c987@appbase-demo-ansible-abxiydt-arc.searchbase.io"
enableAppbase
theme={{
typography: {
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Noto Sans", "Ubuntu", "Droid Sans", "Helvetica Neue", sans-serif',
fontSize: "16px",
},
<MultiList
componentId="genres-list"
dataField="genres.keyword"
className="genres-filter"
size={20}
sortBy="asc"
queryFormat="or"
selectAllLabel="All Genres"
showCheckbox={true}
showCount={true}