fergiemcdowall / search-index

A persistent, network resilient, full text search library for the browser and Node.js
MIT License
1.39k stars 149 forks source link

Release of Version 3 #556

Closed tonprince closed 3 years ago

tonprince commented 3 years ago

I was wondering if there is a roadmap for the release of version 3, as I am looking for support of query like: "koh tao", phrase with 2 words.

With version 2 it is not supported, and even the workaround to put a delimiter like '_' or '-' does not work.

I tried to check with milestone from version 3, but it seams it is not stable yet as basic query does not work.

fergiemcdowall commented 3 years ago

Hi @tonprince

Phrase search only works if you index the phrase.

So when indexing:

{
  text: ['koh', 'tao']    // only gives hits for 'koh' and 'tao'
}

and:

{
  text: ['koh', 'tao', 'koh tao']    // gives hits for 'koh' and 'tao' and the phrase 'koh tao'
}

Use something like ngraminator to create the phrases (n-grams).

Here is the scrum board for search-index@3

eklem commented 3 years ago

For some reason you need to reload the page to not only get an empty scrumboard =)

If you use ngraminator, you need to join the phrases arrays afterwords I think. You can check out how ngraminator works here: https://eklem.github.io/daq-proc/demo/document-processing/

tonprince commented 3 years ago

Thanks