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.

Lower level query interface

See original GitHub issue

A more advanced query interface is something that lunr definitely needs. I’m not entirely sure what the interface would look like for this, perhaps a different method on the index and a query object itself:

idx.query(function () {
    this.all('foo bar*') // these are AND query terms
    this.some('*baz') // these are OR query terms

    this.limit(10) // maximum number of results to return
    this.threshold(0.7) // minimum score for returned documents

    this.facet('herp', ['derp', 'burp']) // facets and values
})

This is just a very rough idea, but I think it is the right direction. It hopefully exposes a more powerful interface to the search. The idx.search method would still exist as a quick way to perform searches, but it would probably be built onto of this query method.

Any input or feedback is much appreciated.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
brockfanningcommented, Oct 5, 2013

This seems great! Would love to have facets!

0reactions
olivernncommented, Apr 10, 2017

It turned out differently the described in this issue, but the latest version of Lunr does provide more control over performing queries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Low-level interfaces - Amazon DynamoDB
Every language-specific AWS SDK provides a low-level interface for Amazon DynamoDB, with methods that closely resemble low-level DynamoDB API requests.
Read more >
Query Interface - Sequelize
The methods from the query interface are therefore lower-level methods; you should use them only if you do not find another way to...
Read more >
Fold DynamoDB low level interface query result into its ...
Recently i had to switch from using high level AWS DynamoDB python boto3 API to the low level one so i could talk...
Read more >
Interfaces in DBMS - GeeksforGeeks
A database management system (DBMS) interface is a user interface that allows for the ability to input queries to a database without using...
Read more >
Query Processing Architecture Guide - SQL Server
The Query Optimizer may choose the view when it contains columns that aren't referenced by the query, as long as the view offers...
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