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.

Searching for numbers

See original GitHub issue

When I search for a field which contains a number, the result is an empty array, I feel that there must be a very clear point that I am missing, could you explain the behaviour? Thank you very much.

const test = [
  {
    data: {
      id: 0,
      name: "foo",
      val: 1
    }
  },
  {
    data: {
      id: 1,
      name: "bar",
      val: 2
    }
  }
]

 const index = new FlexSearch({
    async: true,
    doc: {
      id: "data:id",
      field: ["data:name", "data:val"]
    }
  });

  index.add(test);

  index
    .search(1, {
      field: "data:val"
    })
    .then(result => {
      console.log(result);
//returns empty array
    });
  index
    .search("bar", {
      field: "data:name"
    })
    .then(result => {
      console.log(result);
//returns the object it found
    });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
machado-rcommented, Jul 3, 2020

@maazkabir Sorry for replying 6 months later. I did not find a solution so I switched to Fuse.Js.

0reactions
ts-thomascommented, Jun 28, 2021

Please use a custom “encode” function which allows special chars like “.” or “/”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Searching in Numbers - Apple Community
Searching in Numbers. Cannot search a number f ex 23, it finds 2300 etc. I just want to find 23.
Read more >
Searching for Numbers in Amazon CloudSearch
Search a numeric field for a particular value or range of values using a structured query. ... Searching for Numbers in Amazon CloudSearch....
Read more >
Searching with numbers | Proceedings of the 11th ...
Searching with numbers. Authors: Rakesh Agrawal ... We give algorithms and indexing structures for implementing the search.
Read more >
Search/Browse Help - Numbers Found in LC Catalog Records
LCCN keyword searches can be combined with searches for data found in other fields of the record. Search truncation and wild cards are...
Read more >
Creating Searchable Databases In Numbers (#1696) - YouTube
https://macmost.com/e-1696 If you have a large Numbers table and regularly search and filter it, you may want to use a formula and a...
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