Search response in a progressive way


(Luka) #1

Hi,

getPayload() {
      let textsearch = this.textsearch.replace(/ /g," AND ");
      return {
        q: textsearch,
        lang: this.$store.getters.getLang || 'en',
        engine: this.getSwiftypeEngine
      }
    }

I am trying to query swiftype engine and get the response in a progressive way.
It means that:

When I search for: “elastic” I get an array of objects with 20 results and a property title starting with "elastic" word
When I search for: “elastic s” I get an array of objects with 20 results and a property title starting with exactly “elastic c”

I tried already to change the algorithm by passing AND between two keywords (that works better but not exactly as I would expect).

Free-text Query Syntax
Text searches support a basic subset of the standard Lucene query syntax.
The supported functions are: double quoted strings, + and -, AND, OR, and NOT.
Visit the Lucene documentation for more information.

Do I need to pass anything additional? Is it possible to omit completely the score and return results only containing exact amount of letters?