File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/skin-museum-client/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export async function graphqlSearch(query, options = {}) {
2727}
2828
2929export function algoliaSearch ( query , options = { } ) {
30+ console . log ( "algoliaSearch" , query , options ) ;
3031 return new Promise ( ( resolve , reject ) => {
3132 index . search (
3233 {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
1919 takeWhile ,
2020 mergeAll ,
2121} from "rxjs/operators" ;
22- import { algoliaSearch } from "../algolia" ;
22+ import { algoliaSearch , graphqlSearch } from "../algolia" ;
2323import queryParser from "../queryParser" ;
2424import { CHUNK_SIZE } from "../constants" ;
2525import * as UploadUtils from "../upload/uploadUtils" ;
@@ -138,6 +138,8 @@ const selectSkinReadmeEpic = (actions, states) =>
138138 } )
139139 ) ;
140140
141+ const USE_ALGOLIA = false ;
142+
141143const searchEpic = ( actions ) =>
142144 actions . pipe (
143145 filter ( ( action ) => action . type === "SEARCH_QUERY_CHANGED" ) ,
@@ -148,7 +150,11 @@ const searchEpic = (actions) =>
148150
149151 const [ newQuery , options ] = queryParser ( query ) ;
150152
151- return from ( algoliaSearch ( newQuery , options ) ) . pipe (
153+ return from (
154+ USE_ALGOLIA
155+ ? algoliaSearch ( newQuery , options )
156+ : graphqlSearch ( newQuery , options )
157+ ) . pipe (
152158 map ( ( content ) => {
153159 const matchingSkins = content . hits . map ( ( hit ) => ( {
154160 hash : hit . objectID ,
You can’t perform that action at this time.
0 commit comments