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.

Multi-fields search in documents is not working

See original GitHub issue

Hi,

Following the doc this sample code should work but it yields an empty array. Any clues about what is done wrong?

var { Document } = require(`flexsearch`);

var index = new Document({
  document: {
    id: "id",
    index: ["title"]
  }
});

index.add({
  id: 0,
  title: "I am a test"
});
index.add({
  id: 1,
  title: "I am also a test"
});

var result = index.search([
  {
    field: "title",
    query: "test"
  },
  {
    field: "title",
    query: "also"
  }
]);
console.log(`result`, JSON.stringify(result));

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
micheljungcommented, Oct 20, 2021

@theguy147 do you have any idea how this works with {enrich: true}? I feel like there’s another bug 😃

3reactions
theguy147commented, Oct 18, 2021

Update: @ts-thomas just merged the fix into master, so it should be fixed if you’re on current master now

Read more comments on GitHub >

github_iconTop Results From Across the Web

multifield searching in elasticsearch did not work?
I tried to show all the document which matches either title or body section of article in elastic search and i wrote following...
Read more >
fields | Elasticsearch Guide [8.5] | Elastic
This is the purpose of multi-fields. For instance, a string field could be mapped as a text field for full-text search, and as...
Read more >
FT.AGGREGATE with multi-fields SORTBY to replace FT ...
This is working as expected. A problem arose when I tried to sort documents by multiple fields before the conditions for FT.SEARCH are...
Read more >
Understanding Elasticsearch combined fields and multi match ...
This still returns two documents - and the red esprit dress is ranked higher. In addition you could search for a term that...
Read more >
Apache Lucene Migration Guide
Deleted docs are no longer implicitly filtered from docs/positions enums. ... in particular the MultiFields TermsEnum does not implement them.
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