question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Paging with mutltiple fields/boost.

See original GitHub issue

Setup

var index = FlexSearch.create({
    doc: {
        id: "url",
        field: [
            "title",
            "content"
        ]
    }
});

Working

Invoke:

index.search(
    "test",
    {
        page: true,
        limit: 5
    })

Result:

{
  "page": "0",
  "next": "5",
  "result": [
    {
      "title": "Load Testing V. 1.0.1",
      "content": "test",
      "url": "/Project_Management/validations/validation2"
    },
    {
      "title": "Pre Test Inpsection Report",
      "content": "test",
      "url": "/V_and_V/5016-09-F21"
    },
    {
      "title": "Packaging Validaiton Test Report",
      "content": "test",
      "url": "/V_and_V/5016-09-F19"
    },
    {
      "title": "EMC 60601 Test Plan",
      "content": "test",
      "url": "/V_and_V/5016-09-F23"
    },
    {
      "title": "Third Party Testing",
      "content": "test",
      "url": "/3rd_Party_Testing"
    }
  ]
}

Not working

Invoke:

index.search(
    [
        {
            field: "title",
            query: "test",
            boost: 1
        },
        {
            field: "content",
            query: "test",
            boost: 0.5
        }
    ],
    {
        page: true,
        limit: 5
    }));

Result:

{
  "page": "0",
  "next": null,
  "result": [
  ]
}

Comments

I need to be able to page the results, while also search multiple fields with different boost values.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pauldotknopfcommented, Apr 3, 2019

Hmm, in the README, it mentions it’s supported. What is this in reference to?

0reactions
ts-thomascommented, Jun 28, 2021

Please change over to the version >= 0.7.x, thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

elasticsearch: multiple fields with boosts - Stack Overflow
I am trying to create a query for elasticsearch. The conditions: there is always a customer filter. There is a field "name" that...
Read more >
How to work with search results - Azure Cognitive Search
Scoring profiles give you more control over the ranking of items in search results, with the ability to boost matches found in specific...
Read more >
boost | Elasticsearch Guide [7.17] | Elastic
Individual fields can be boosted automatically — count more towards the relevance score — at query time, with the boost parameter as follows:....
Read more >
The DisMax Query Parser | Apache Solr Reference Guide 7.2
The qf parameter introduces a list of fields, each of which is assigned a boost factor to increase or decrease that particular field's...
Read more >
Boosting - Coding Explained -
Documents containing this phrase within their name field will have a boosted relevancy score. Of course this makes more sense if you are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found