fergiemcdowall / search-index

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

weights don't work #561

Closed naveen9 closed 2 years ago

naveen9 commented 2 years ago

As i used your example for SCOREd query with WEIGHT then , it is not giving any response to me

My JSON data [ { "id":"1", "project":"title", "message":"test" }, { "id":"2", "project":"test", "reviewinstruction":"this is test" } { "id":"3", "project":"my project", "reviewinstruction":"review" }, { "id":"4", "project":"title", "message":"test your are the best way" }, ];

weight AND queries

QUERY({ SEARCH: [ 'test' ] }, { SCORE: { WEIGHT: { 'reviewinstruction': 2 // reviewinstruction is field } } })

Am i missing something in SCOREd query with WEIGHT ?

fergiemcdowall commented 2 years ago

Hi @naveen9

Sorry for the late reply!

WEIGHTing has been slightly rejigged in version 3. You can see the new API and checkout out the tests for examples