Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine AND and OR boolean to search all terms #95

Open
JGrndn opened this issue Nov 22, 2018 · 1 comment
Open

Combine AND and OR boolean to search all terms #95

JGrndn opened this issue Nov 22, 2018 · 1 comment

Comments

@JGrndn
Copy link

JGrndn commented Nov 22, 2018

Hello,

I've read the documentation multiple times, and I'm not sure I found the answer I'm looking for...

Considering I have the following document
var a = { title: "Oracle presentation", content: "This is a quick presentation of the database" };
var b = { title: "Oracle presentation", content: "This is a quick presentation of Oracle" };
var c = { title: "Database presentation", content: "This is a quick presentation of the database" };
and the default condiguration.

Consider that I search for "Oracle database".

  • with OR boolean : all documents will be retrieved
  • with AND boolean : none of them will be retrieved as there is no field containing both "Oracle" and "database".

So my question is :
is there a way to retrieve the very first document, as "Oracle" in is one field and "database" in another ? (and I want to retrieve documents only if they contains all terms)

Thanks for your help !

@blackholeearth
Copy link

blackholeearth commented Nov 3, 2023

How to Bring oracle 1st , if its on title :

for you, that means title is more important.
You have to give it a bigger boost number.

İf u increase boost number on a field, that field' will be more important.
That result will come up higher than previous search.

Query time boost at Readme.md

index.search("Oracle database profit", {
    fields: {
        title: {boost: 2},
        content: {boost: 1}
    }
});

Edit :
pls add theese to end of ur question title : ranking , sorting , scoring ,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants