Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Custom search issues #43

@bkanuka

Description

@bkanuka

First part of this I figured out on my own. In lib/searc/index.js line 55 needs to be:

    if(!options || !options.command) {

because options is config.search and so options.search is undefined and you never get to use a custom command!

Second part I can't figure out. I have a dummy search program that prints "./output.pdf" to console rigth now but I can't get it to work. Error is: Path must be a string. Received [ '/output.pdf' ]. Full output below

Sorry if the line numbers don't up - I added some debug lines on my own trying to figure this out. I'm new to node.js so...thanks for being helpful and patient with me!

  explorer:search Data [ '/output.pdf' ] +28ms
  explorer:tree Tree for path /output.pdf and options { search: '', sort: '', order: 'asc', page: 1, root: '/nas', path: '/nas', parent: '/nas', buildUrl: [Function: buildUrl], extend: [Function: extend], urlOptions: { limit: undefined, order: 'asc'
, sort: undefined, page: 1 }, hooks: { upload: { menu: [Function: menu] }, archive: { action: [Function: action] }, move: { action: [Function: action], directory: [Function: directory] } }, notifications: { num: 0, move: [], archive: [], upload: [] 
}, user: { username: 'admin', home: '/nas', key: 'ic1XNtmjNPWyiWFQKfS0h7B5j', admin: 1, readonly: 0, ignore: '', trash: '', archive: '', upload: '', getCookie: [Function: getCookie], sanitize: [Function: sanitize], isValid: [Function: isValid], valu
eToIntegerBool: [Function: valueToIntegerBool], crypt: [Function: crypt], generateKey: [Function: generateKey], update: [Function: update], toString: [Function: toString] }, upload: { concurrency: 10, maxSize: '100mb', maxCount: 10, path: '/root/.co
nfig/explorer/upload' }, messages: { info: [], error: [] }, app_root: '/', cacheTTL: 86400, cache: { time: MemoryCache { namespace: 'tree:time' }, size: MemoryCache { namespace: 'tree:size' } }, concurrency: 100, maxDepth: 10, limit: 100, remove: { 
method: 'mv', path: '/root/.config/explorer/trash' }, archive: { path: '/root/.config/explorer/tmp' }, filters: [ [Function: noDotFiles] ] } +9ms
  explorer:tree paths function path:/output.pdf +1ms
  explorer:tree path: /output.pdf +3ms
  explorer:tree f: /output.pdf +1ms
TypeError: Path must be a string. Received [ '/output.pdf' ]
    at assertPath (path.js:28:11)
    at Object.join (path.js:1246:7)
    at /opt/explorer/lib/tree.js:269:15
    at tryCatcher (/opt/explorer/node_modules/bluebird/js/main/util.js:26:23)
    at MappingPromiseArray._promiseFulfilled (/opt/explorer/node_modules/bluebird/js/main/map.js:56:38)
    at MappingPromiseArray.init (/opt/explorer/node_modules/bluebird/js/main/promise_array.js:92:18)
    at MappingPromiseArray.init (/opt/explorer/node_modules/bluebird/js/main/map.js:29:23)
    at Async._drainQueue (/opt/explorer/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/opt/explorer/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/opt/explorer/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
2018-01-19 22:29:41 Error: A server error occur, if this happens again please contact the administrator: Path must be a string. Received [ '/output.pdf' ]
    at new HTTPError (/opt/explorer/lib/HTTPError.js:12:17)
    at Spawner.<anonymous> (/opt/explorer/lib/utils.js:182:18)
    at tryCatch1 (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/util.js:63:19)
    at Promise$_callHandler [as _callHandler] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/promise.js:695:13)
    at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/promise.js:711:18)
    at Promise$_settlePromiseAt [as _settlePromiseAt] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/promise.js:868:14)
    at Promise$_settlePromises [as _settlePromises] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/promise.js:1006:14)
    at Promise$_rejectPromises [as _rejectPromises] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/promise.js:999:10)
    at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/async.js:74:12)
    at Async$consumeFunctionBuffer (/opt/explorer/node_modules/promise-spawner/node_modules/bluebird/js/main/async.js:37:14)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
GET /search?search=&path=%2Fnas 302 124.843 ms - 88

Side note: I'm working on a docker image that integrates your explorer with recoll search so that I can search inside files. I'll put it up on github soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions